|
@@ -9,6 +9,18 @@ vim.lsp.config("*", {
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
|
|
+local function read_helix_config()
|
|
|
|
+ local tinytoml = require("tinytoml")
|
|
|
|
+ local data = vim.secure.read(".helix/languages.toml")
|
|
|
|
+ if data ~= nil then
|
|
|
|
+ local status, data = pcall(tinytoml.parse, data, { load_from_string = true })
|
|
|
|
+ if status then
|
|
|
|
+ return data
|
|
|
|
+ end
|
|
|
|
+ end
|
|
|
|
+ return {}
|
|
|
|
+end
|
|
|
|
+
|
|
vim.lsp.enable("bashls");
|
|
vim.lsp.enable("bashls");
|
|
vim.lsp.enable("eslint");
|
|
vim.lsp.enable("eslint");
|
|
|
|
|
|
@@ -22,6 +34,17 @@ end
|
|
if vim.fn.executable("deno") == 1 then
|
|
if vim.fn.executable("deno") == 1 then
|
|
vim.lsp.enable("deno");
|
|
vim.lsp.enable("deno");
|
|
else
|
|
else
|
|
|
|
+ local preferences = {
|
|
|
|
+ importModuleSpecifierPreference = 'non-relative',
|
|
|
|
+ -- this prevents renames from aliasing when destructuring
|
|
|
|
+ providePrefixAndSuffixTextForRename = false,
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ local helix_preferences = vim.tbl_get(read_helix_config(), 'language-server', 'typescript-language-server', 'config', 'preferences')
|
|
|
|
+ if helix_preferences ~= nil then
|
|
|
|
+ preferences = vim.tbl_deep_extend('force', preferences, helix_preferences)
|
|
|
|
+ end
|
|
|
|
+
|
|
local function make_settings()
|
|
local function make_settings()
|
|
-- we disable formatting but these are still used when performing some code
|
|
-- we disable formatting but these are still used when performing some code
|
|
-- actions
|
|
-- actions
|
|
@@ -38,11 +61,7 @@ else
|
|
vim.lsp.config("ts_ls", {
|
|
vim.lsp.config("ts_ls", {
|
|
init_options = {
|
|
init_options = {
|
|
completionDisableFilterText = true,
|
|
completionDisableFilterText = true,
|
|
- preferences = {
|
|
|
|
- importModuleSpecifierPreference = 'non-relative',
|
|
|
|
- -- this prevents renames from aliasing when destructuring
|
|
|
|
- providePrefixAndSuffixTextForRename = false,
|
|
|
|
- },
|
|
|
|
|
|
+ preferences = preferences,
|
|
},
|
|
},
|
|
settings = make_settings(),
|
|
settings = make_settings(),
|
|
handlers = {
|
|
handlers = {
|