Skip to content
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 from template not work in 0.28.0 #2341

Closed
3 tasks done
tuan-lm opened this issue Sep 28, 2020 · 4 comments
Closed
3 tasks done

Go to definition from template not work in 0.28.0 #2341

tuan-lm opened this issue Sep 28, 2020 · 4 comments

Comments

@tuan-lm
Copy link

tuan-lm commented Sep 28, 2020

  • I have searched through existing issues
  • I have read through docs
  • I have read FAQ

Info

  • Platform: Window 10 Pro
  • Vetur version: 0.28.0
  • VS Code version: 1.49.2

Problem

Go to definition from template not working when update to vetur 0.28.0.
Work just fine when downgrade to 0.27.3

Reproducible Case

In VS Code with vetur 0.28.0, hover any variable or function, Ctrl + click won't go to definition, instead show this error in the bottom right in vscode window

Capture

Temporary solution: Downgrade vetur back to 0.27.3

@yoyo930021
Copy link
Member

Please provide a reproducible project.
https://github.com/vuejs/vetur/blob/master/.github/NO_REPRO_CASE.md

@benrwb
Copy link

benrwb commented Oct 13, 2020

I'm having the same problem (using Vetur 0.28.0 on Windows 10).

When I click "Go to definition", Visual Studio closes the file I am working on, and displays a message "unable to open 'file.vue': Unable to resolve resource (path)"
I noticed that the path contains forward slashes (e.g. c:/path/to/file) instead of the usual convention on Windows of using backslashes (c:\path\to\file). I don't know if that's significant.

I think this might be the same problem as issue #1484, which was fixed in #2161
I believe it was caused by path handling inconsistencies between Windows and Mac/Linux.
#2161 updated server/src/modes/template/interpolationMode.ts, by wrapping 2 uri's in URI.file

I have just checked the latest version of interpolationMode.ts, and the calls to URI.file have been removed, which could explain why the problem has resurfaced.

@ghostlhq
Copy link

image
Got the same problem when I was learning the VUE.
The image above is when I using the TypeScript language, and here's the JavaScript version
image
In ts I can get the suggestion in template, but I can't use go to the definition in the <script>, it can only shows the 'any' as prop;
In js I can use the go to the definition in , but I can't get any suggestion in <template;
Amazing!

@octref
Copy link
Member

octref commented Oct 30, 2020

@benrwb It's due to me being sloppy with git, probably what happened was I did a merge of an old PR, resolved the 3-way diff but didn't catch the URI.file call. I'll make sure to always rebase first...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants