fix(extras.lang.vue) missing typescript autocomplete in .vue files (#3401)

* Fix missing autocomplete in .vue files

The existing Vue extra was not properly configuring vtsls to use the globalPlugin: '@vue/typescript-plugin'

This commit fixes missing typescript autocomplete in .vue files.

* move @vue/typescript-plugin back to extend function call

* tidy LazyVim.extend() arguments
This commit is contained in:
Emma Eilefsen Glenna 2024-05-31 20:52:01 +02:00 committed by GitHub
parent abc6554e24
commit 07ff12f5eb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,9 +18,9 @@ return {
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
opts = function(_, opts) opts = function(_, opts)
local vue_typescript_plugin = require("mason-registry").get_package("vue-language-server"):get_install_path() local vue_typescript_plugin = require("mason-registry")
.. "/node_modules/@vue/language-server" .get_package("vue-language-server")
.. "/node_modules/@vue/typescript-plugin" :get_install_path() .. "/node_modules/@vue/language-server" .. "/node_modules/@vue/typescript-plugin"
opts.servers = vim.tbl_deep_extend("force", opts.servers, { opts.servers = vim.tbl_deep_extend("force", opts.servers, {
volar = {}, volar = {},
@ -38,12 +38,14 @@ return {
}, },
}, },
}) })
LazyVim.extend(opts.servers.vtsls.settings.vtsls.tsserver.globalPlugins, {
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
name = "@vue/typescript-plugin", name = "@vue/typescript-plugin",
location = vue_typescript_plugin, location = vue_typescript_plugin,
languages = { "vue" }, languages = { "vue" },
configNamespace = "typescript",
}) })
end, end,
}, },
} }