Migrated to vue-language-server 3.0.x

This commit is contained in:
2025-07-21 10:26:11 +02:00
parent 59f4064788
commit 08784c625a

View File

@@ -65,26 +65,40 @@ function LSPRangeFormatFunction()
}) })
end end
-- Set different settings for different languages' LSP
-- use globally installed vue-language-server (instead of mason provided) -- VUE and Typescript as of vue-language-server 3.0.x
vim.lsp.config('vue_ls', { -- taken from:
-- add filetypes for typescript, javascript and vue -- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#vtsls
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' }, local vue_language_server_path = '/home/saschal/.config/yarn/global/node_modules'
init_options = { local vue_plugin = {
vue = { name = '@vue/typescript-plugin',
-- disable hybrid mode, will thus use ts_ls internally location = vue_language_server_path,
hybridMode = false, languages = { 'vue' },
configNamespace = 'typescript',
}
local vtsls_config = {
settings = {
vtsls = {
tsserver = {
globalPlugins = {
vue_plugin,
},
},
}, },
}, },
}) filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
}
vim.lsp.config('vtsls', vtsls_config)
-- enable this list of lsps
local enable_this_lsp = { local enable_this_lsp = {
'vue_ls', 'vue_ls',
'vtsls',
'gopls', 'gopls',
'bashls', 'bashls',
'html', 'html',
'lua_ls', 'lua_ls',
'jsonls',
} }
for l in pairs(enable_this_lsp) do for l in pairs(enable_this_lsp) do