-
-
Notifications
You must be signed in to change notification settings - Fork 378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Go to definition is not working in vue SFC components (*.vue files) #4106
Comments
Where can I view your nvim config? I can't find the settings for tsserver. If possible, please also provide a vue file to reproduce the error. |
Thanks for the quick response. I cannot attach code of the project I am working on, but code of the components looks like this: MyComponentContainer.vue <template>
<MyButton>Some text</MyButton>
</template>
<script setup lang="ts">
import MyButtom from '@/components/MyButton';
</script> BTW I am using vue 3.2.47 and typescript 4.7.4 |
Hm, I even tried your config (wich may be inspired by "dev as life" ;) ) and "go to definition" still does not work properly. Big chances that is something off with my project. I tried projects without TS and "go to definition" opens components just fine. But I also tried some Vue+TS projects in particular Evan's You wordle https://github.com/yyx990803/vue-wordle BTW issue is started when I decided moving from lazyVim into custom config. But right now even my old lazyVim config is not working. |
It sounds very strange. I tried the vue-cli project and yyx990803/vue-wordle, and it worked fine for me. What is your version of @vue/typescript-plugin? |
@vue/typescript-plugin 2.0.6. I installed it with npm globally and even installed it into the project itself |
Thanks you for your time. You can close this issue as completed but I also wanna ask, do you know how can I check that tsserver is loading @vue/typescript plugin? |
Honestly, I'm not sure either. However, as far as I know, if @vue/typescript-plugin is not loaded correctly, you probably won't receive any messages indicating its status. So, if you are certain that @vue/typescript-plugin has been loaded but you are unable to use "Go to definition" correctly, then it might be an issue with Volar itself, and you should continue to investigate this further. |
Good day to you.
I setup tsserver as described in configuration:
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#vue-support
But when I use "go to definition" with cursor under custom component name inside template section I always end up in shims-vue.d.ts file of my project. Same if I use go to defenition on component name in import in script section of SFC.
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:
Than I use
lua vim.lsp.buf.definition()
Expected behavior
The file with my component is opened
Neovim version (nvim -v)
0.9.5
Language server name/version
typescript-language-sever 4.3.3, vue-language-server 2.0.6
Operating system/version
linux mint 21
Log file
https://gist.github.com/FreshHead/64b96748af826e3f8c0406561c4b4cd6
The text was updated successfully, but these errors were encountered: