Go to definition is not working in vue SFC components (*.vue files) #27891
-
ProblemGood day to you. https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#vue-support But when I use "go to definition" with cursor under some custom component I always end up in shims-vue.d.ts file of my project. Probably that is out of neovim scope. But maybe there is a smallest chance that configuration example can be updated somehow. My neovim config is based on kickstart.nvim. Below is the part made by instructions in https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#vue-support: tsserver = {
filetypes = {
'typescript',
'vue',
},
init_options = {
plugins = {
{
name = '@vue/typescript-plugin',
location = '/home/u/.nvm/versions/node/v20.8.0/lib/node_modules/@vue/typescript-plugin',
languages = { 'javascript', 'typescript', 'vue' },
},
},
},
},
volar = { filetypes = { 'vue' } }, Than I use Expected behaviorThe file with my component is opened Neovim version (nvim -v)0.9.5 Language server name/versiontypescript-language-sever 4.3.3, vue-language-server 2.0.6 Operating system/versionlinux mint 21 Log filehttps://gist.github.com/FreshHead/64b96748af826e3f8c0406561c4b4cd6 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
which version? Volar's go to definition doesn't work for vue2. local data_path = vim.fn.stdpath('data')
local location = data_path.."/mason/packages/vue-language-server/node_modules/@vue/language-server"
return {
init_options = {
plugins = {
{
name = "@vue/typescript-plugin",
location = location,
languages = {"javascript", "typescript", "vue"},
},
},
},
filetypes = {
"javascript",
"typescript",
"vue",
},
} |
Beta Was this translation helpful? Give feedback.
which version? Volar's go to definition doesn't work for vue2.
In addition,the location should be the path of volar otherwise it doesn't work for me.