LSP uses system wide vue-language-server, mason sucks here
This commit is contained in:
22
lua/lsp.lua
22
lua/lsp.lua
@@ -68,9 +68,7 @@ require('mason-lspconfig').setup({
|
||||
'lua_ls',
|
||||
-- 'rust_analyzer', -- handled by rust mrcjkb/rustaceanvim
|
||||
'yamlls',
|
||||
'ts_ls',
|
||||
'gopls',
|
||||
'clangd',
|
||||
},
|
||||
})
|
||||
|
||||
@@ -86,20 +84,20 @@ function LSPRangeFormatFunction()
|
||||
end
|
||||
|
||||
-- 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)
|
||||
vim.lsp.config('vue_ls', {
|
||||
-- add filetypes for typescript, javascript and vue
|
||||
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
|
||||
init_options = {
|
||||
plugins = {
|
||||
{
|
||||
name = '@vue/typescript-plugin',
|
||||
location = vim.fn.expand '$MASON/packages' .. '/vue-language-server' .. '/node_modules/@vue/language-server',
|
||||
languages = { 'vue' },
|
||||
},
|
||||
vue = {
|
||||
-- disable hybrid mode
|
||||
hybridMode = false,
|
||||
},
|
||||
},
|
||||
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
|
||||
}
|
||||
})
|
||||
vim.lsp.enable('vue_ls')
|
||||
|
||||
|
||||
-- add autoformat to Dioxus projects
|
||||
vim.api.nvim_create_autocmd("BufWritePost", {
|
||||
|
||||
Reference in New Issue
Block a user