vuejs / language-tools

⚡ High-performance Vue language tooling based-on Volar.js
https://marketplace.visualstudio.com/items?itemName=Vue.volar
MIT License
5.87k stars 403 forks source link

In VS Code, "Go to definition" is not working for option API in vue3 #4916

Open stephane303 opened 1 month ago

stephane303 commented 1 month ago

Vue - Official extension or vue-tsc version

vue-tsc: 2.1.6

VSCode version

1.94.1

Vue version

3.5.11

TypeScript version

5.4.5

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (24) x64 AMD Ryzen 9 3900XT 12-Core Processor
    Memory: 14.11 GB / 31.92 GB
  Binaries:
    Node: 20.15.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.22 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 10.8.3 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.12.1 - ~\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527

package.json dependencies

"dependencies": {
    "vue": "^3.5.11"
  },
  "devDependencies": {
    "@tsconfig/node20": "^20.1.4",
    "@types/node": "^20.16.11",
    "@vitejs/plugin-vue": "^5.1.4",
    "@vue/tsconfig": "^0.5.1",
    "npm-run-all2": "^6.2.3",
    "typescript": "~5.4.5",
    "vite": "^5.4.8",
    "vue-tsc": "^2.1.6"
  }

Steps to reproduce

  1. pnpm i
  2. open project in VS Code
  3. open file App.vue
  4. ctrl-click on <TheWelcome> on line 11

What is expected?

The file TheWelcome.vue is open

What is actually happening?

The cursor just move to components: { HelloWorld, TheWelcome } in the same file

Link to minimal reproduction

https://github.com/stephane303/vue-vscode-issue

Any additional comments?

No response

damon1205 commented 1 month ago

Correct TypeScript Configuration

{ "extends": "@vue/tsconfig/tsconfig.web.json", "compilerOptions": { "moduleResolution": "node", "types": ["vite/client"], "skipLibCheck": true, "module": "ESNext" }, "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"] }

stephane303 commented 1 month ago

{ "extends": "@vue/tsconfig/tsconfig.web.json", "compilerOptions": { "moduleResolution": "node", "types": ["vite/client"], "skipLibCheck": true, "module": "ESNext" }, "include": ["src//*.ts", "src/*/.d.ts", "src//*.tsx", "src/*/.vue"] }

Which file ? I have

tsconfig.json
tsconfig.node.json
tsconfig.app.json

The demo project was created with pnpm create vue

I tried your config in tsconfig.json, but that does not help.

liangyao375 commented 1 month ago

Using version 2.0.16

stephane303 commented 1 month ago

Using version 2.0.16

not working either ....

amaelftah commented 3 weeks ago

i have the same issue too and not using typescript