Files
LazyVim/lua/lazyvim/plugins/extras/lang/vue.lua
xiaojianzheng 5070694861 fix(vue): disable volar hybrid mode since it interferes with tsserver (#3654)
can not inc-rename when volar is enabled.

After the configuration in commit was added, the inc-rename operation
returned to normal.

I suspect that volar's Hybrid mode affects the rename operation.


https://github.com/vuejs/language-tools?tab=readme-ov-file#none-hybrid-modesimilar-to-takeover-mode-configuration-requires-vuelanguage-server-version-207

Co-authored-by: 肖健正 <xiaojianzheng@qq.com>
2024-06-14 23:06:53 +02:00

51 lines
1.1 KiB
Lua

return {
recommended = function()
return LazyVim.extras.wants({
ft = "vue",
root = { "vue.config.js" },
})
end,
-- depends on the typescript extra
{ import = "lazyvim.plugins.extras.lang.typescript" },
{
"nvim-treesitter/nvim-treesitter",
opts = { ensure_installed = { "vue" } },
},
-- Add LSP servers
{
"neovim/nvim-lspconfig",
opts = {
servers = {
volar = {
init_options = {
vue = {
hybridMode = false,
},
},
},
vtsls = {},
},
},
},
-- Configure tsserver plugin
{
"neovim/nvim-lspconfig",
opts = function(_, opts)
table.insert(opts.servers.vtsls.filetypes, "vue")
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
{
name = "@vue/typescript-plugin",
location = LazyVim.get_pkg_path("vue-language-server", "/node_modules/@vue/language-server"),
languages = { "vue" },
configNamespace = "typescript",
enableForWorkspaceTypeScriptVersions = true,
},
})
end,
},
}