-
I have followed the official lspconfig-all to have lsp support for vue 3 in my neovim configuration.
and in ~/.config/nvim/lsp/vtsls.lua :
(copied just like that from lspconfig-all )
I have neovim/nvim-lspconfig as a plugin and i use Lazy plugin manager. the rest are nvim defaults. Other lsp work, like jdtls |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
This didn't work on my config, only this worked: -- Vue Language Server 3.x configuration with ts_ls
-- Setup ts_ls for TypeScript/JavaScript with Vue support
lspconfig.ts_ls.setup({
init_options = {
plugins = {
{
name = "@vue/typescript-plugin",
location = vim.fn.expand("~/.local/share/pnpm/global/5/node_modules/@vue/typescript-plugin"),
languages = { "vue" },
},
},
},
filetypes = {
"javascript",
"javascriptreact",
"javascript.jsx",
"typescript",
"typescriptreact",
"typescript.tsx",
"vue",
},
})
-- Setup volar for Vue files
-- Disable TypeScript features in volar since ts_ls handles them
lspconfig.volar.setup({
filetypes = { "vue" },
init_options = {
typescript = {
tsdk = vim.fn.expand("~/.local/share/pnpm/global/5/node_modules/typescript/lib/"),
},
},
on_attach = function(client, _)
-- Define which capabilities are Vue-specific and should remain enabled
-- To maintain this list use https://gist.github.com/coffebar/59d7496c9735547bacb28059708ff0fd
local vue_only = {
colorProvider = true,
documentLinkProvider = true,
documentOnTypeFormattingProvider = true,
experimental = true,
linkedEditingRangeProvider = true,
textDocumentSync = true,
workspace = true,
}
-- Disable all capabilities except those in the whitelist
for capability, _ in pairs(client.server_capabilities) do
if not vue_only[capability] then
client.server_capabilities[capability] = false
end
end
end,
}) |
Beta Was this translation helpful? Give feedback.
-
There's not enough information for me to troubleshoot this issue, if it's enabled but not attached can you first check with |
Beta Was this translation helpful? Give feedback.
Okay so i solved somehow my problem. I downgraded my neovim version to the latest stable release 0.11.4 . I had 0.12.0-dev somehow. Im not sure 100% if that was the problem, but it works for now.