LSP uses system wide vue-language-server, mason sucks here

This commit is contained in:
2025-07-04 12:05:23 +02:00
parent 75f9692e7d
commit 270222bb57

View File

@@ -68,9 +68,7 @@ require('mason-lspconfig').setup({
'lua_ls', 'lua_ls',
-- 'rust_analyzer', -- handled by rust mrcjkb/rustaceanvim -- 'rust_analyzer', -- handled by rust mrcjkb/rustaceanvim
'yamlls', 'yamlls',
'ts_ls',
'gopls', 'gopls',
'clangd',
}, },
}) })
@@ -86,20 +84,20 @@ function LSPRangeFormatFunction()
end end
-- Set different settings for different languages' LSP -- Set different settings for different languages' LSP
local lspconfig = require('lspconfig')
lspconfig.ts_ls.setup { -- use globally installed vue-language-server (instead of mason provided)
init_options = { vim.lsp.config('vue_ls', {
plugins = { -- add filetypes for typescript, javascript and vue
{
name = '@vue/typescript-plugin',
location = vim.fn.expand '$MASON/packages' .. '/vue-language-server' .. '/node_modules/@vue/language-server',
languages = { 'vue' },
},
},
},
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' }, filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
} init_options = {
vue = {
-- disable hybrid mode
hybridMode = false,
},
},
})
vim.lsp.enable('vue_ls')
-- add autoformat to Dioxus projects -- add autoformat to Dioxus projects
vim.api.nvim_create_autocmd("BufWritePost", { vim.api.nvim_create_autocmd("BufWritePost", {