Use vtsls + vue_ls

This commit is contained in:
Jan Hamal Dvořák 2025-07-29 18:11:14 +02:00
parent 08d87565fa
commit 3df862b86b
Signed by: mordae
GPG key ID: 1782BCC23EE007B9

View file

@ -107,26 +107,33 @@ vim.lsp.config("hls", {
local yarn_path = vim.fn.expand("$HOME/.config/yarn/global/node_modules") local yarn_path = vim.fn.expand("$HOME/.config/yarn/global/node_modules")
vim.lsp.enable("ts_ls") vim.lsp.enable("vtsls")
vim.lsp.config("ts_ls", { vim.lsp.config("vtsls", {
init_options = { settings = {
plugins = { vtsls = {
tsserver = {
globalPlugins = {
{ {
configNamespace = "typescript",
name = "@vue/typescript-plugin", name = "@vue/typescript-plugin",
location = yarn_path .. "/@vue/typescript-plugin", location = yarn_path .. "/@vue/typescript-plugin",
languages = { "javascript", "typescript", "vue" }, languages = { "vue" },
},
},
}, },
}, },
}, },
filetypes = { filetypes = {
"javascript", "javascript",
"javascriptreact",
"typescript", "typescript",
"typescriptreact",
"vue", "vue",
}, }
}) })
vim.lsp.enable("volar") vim.lsp.enable("vue_ls")
vim.lsp.config("volar", { vim.lsp.config("vue_ls", {
init_options = { init_options = {
typescript = { typescript = {
tsdk = yarn_path .. "/typescript/lib", tsdk = yarn_path .. "/typescript/lib",