[LSP] Rmove ts_ls and replace with vtsls

This commit is contained in:
2025-10-13 14:23:07 +02:00
parent 78dbc95ea5
commit e316620f0d
2 changed files with 23 additions and 14 deletions

View File

@@ -36,21 +36,22 @@ lsp.config("vue_ls", {
}, },
}) })
local vue_language_server_path = vim.fn.expand("$MASON/packages")
.. "/vue-language-server"
.. "/node_modules/@vue/language-server"
local vue_plugin = {
name = "@vue/typescript-plugin",
location = vue_language_server_path,
languages = { "vue" },
configNamespace = "typescript",
}
-- ┌ ┐ -- ┌ ┐
-- │ TS, JS, TSX, JSX │ -- │ TS, JS, TSX, JSX │
-- └ ┘ -- └ ┘
lsp.config("ts_ls", { lsp.config("vtsls", {
capabilities = capabilities, capabilities = capabilities,
on_attach = on_attach_no_formatting, on_attach = on_attach_no_formatting,
init_options = {
plugins = {
{
name = "@vue/typescript-plugin",
location = "/usr/lib/node_modules/@vue/typescript-plugin",
languages = { "javascript", "typescript", "vue" },
},
},
},
filetypes = { filetypes = {
"javascript", "javascript",
"typescript", "typescript",
@@ -58,13 +59,21 @@ lsp.config("ts_ls", {
"javascriptreact", "javascriptreact",
"vue", "vue",
}, },
settings = {
vtsls = {
tsserver = {
globalPlugins = {
vue_plugin,
},
},
},
},
}) })
-- ── Enable configs ─────────────────────────────────────────────── -- ── Enable configs ───────────────────────────────────────────────
local enable = vim.lsp.enable local enable = vim.lsp.enable
enable("jsonls") enable("jsonls")
enable("html") enable("html")
enable("cssls") enable("cssls")
enable("vue_ls") enable("vue_ls")
enable("ts_ls") enable("vtsls")

View File

@@ -40,9 +40,9 @@ return {
"pyright", "pyright",
"rust_analyzer", "rust_analyzer",
"ruby_lsp", "ruby_lsp",
-- "ts_ls",
"vue_ls",
"verible", "verible",
"vtsls",
"vue_ls",
}, },
-- auto-install configured servers (with lspconfig) -- auto-install configured servers (with lspconfig)
automatic_enable = false automatic_enable = false