Update home/modules/nvim/config/lsp/ts_ls.lua
This commit is contained in:
parent
98e3a59438
commit
bba0603fae
1 changed files with 1 additions and 13 deletions
|
|
@ -1,7 +1,4 @@
|
|||
local dnscUtils = require("dnsc.utils")
|
||||
|
||||
return {
|
||||
init_options = { hostInfo = "neovim" },
|
||||
cmd = { "typescript-language-server", "--stdio" },
|
||||
filetypes = {
|
||||
"javascript",
|
||||
|
|
@ -13,20 +10,11 @@ return {
|
|||
},
|
||||
root_markers = { "tsconfig.json", "package.json", ".git" },
|
||||
init_options = {
|
||||
hostInfo = "neovim",
|
||||
preferences = {
|
||||
importModuleSpecifierPreference = "relative",
|
||||
importModuleSpecifierEnding = "minimal",
|
||||
},
|
||||
},
|
||||
handlers = {
|
||||
["textDocument/definition"] = function(err, result, method, ...)
|
||||
if vim.tbl_islist(result) and #result > 1 then
|
||||
local filtered_result = dnscUtils.filter(result, dnscUtils.filterReactDTS)
|
||||
return vim.lsp.handlers["textDocument/definition"](err, filtered_result, method, ...)
|
||||
end
|
||||
|
||||
vim.lsp.handlers["textDocument/definition"](err, result, method, ...)
|
||||
end,
|
||||
},
|
||||
single_file_support = true,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue