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

When import .vue file in ts via path alias, Ctrl + Click can not jump to the definition. #435

Closed
shixinla opened this issue Aug 30, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@shixinla
Copy link

When import .vue file in ts via path alias, Ctrl + Click can not jump to the definition any more, and the path intellisense can not find .vue file too.

Howerver, it works in v0.27.3 and before.

behavior in v0.27.3:
GIF 2021-8-30 15-33-17
behavior after v0.27.3(0.27.9):
GIF 2021-8-30 15-30-21

info

Volar version: 0.27.9
Vue TS Plugin: on
tsconfig:

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "moduleResolution": "node",
    "strict": true,
    "jsx": "preserve",
    "sourceMap": true,
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "lib": ["esnext", "dom"],
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"],
      "@/tests/*": ["tests/*"]
    }
  },
  "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"]
}

Vscode info:

Version: 1.59.1 (user setup)
Commit: 3866c3553be8b268c8a7f8c0482c0c0177aa8bfa
Date: 2021-08-19T11:56:46.957Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Windows_NT x64 10.0.17763
@johnsoncodehk
Copy link
Member

It seem TS plugin not working in 0.27.9, thanks for the report!

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Aug 30, 2021
@tuan-lm97
Copy link

It look like this problem reappear recently.
v0.30.3 to be exact

@johnsoncodehk
Copy link
Member

@tuan-lm97 I can confirmed this, thanks for letting me know.

@erradil
Copy link

erradil commented Mar 6, 2022

I spend a lot of time to know the origin of issue (it's still persist in 0.32.1)
the solution is simply to install this vscode extension
https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.vscode-typescript-vue-plugin

I hope it's useful

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Mar 10, 2022

@erradil See #664.

This problem is actually a bit difficult to solve. Takeover mode is better than TS plugin in all aspects and does not have this problem. I recommend always using takeover mode. Are there any circumstances must to use TS plugin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants