vuejs / language-tools

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

vscode go to definition not working in HTML language #4920

Open tidus2102 opened 2 days ago

tidus2102 commented 2 days ago

Vue - Official extension or vue-tsc version

2.1.6

VSCode version

1.91.1

Vue version

3.5.12

TypeScript version

none

System Info

System:
    OS: macOS 15.0
    CPU: (8) arm64 Apple M1
    Memory: 612.30 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - /usr/local/bin/node
    Yarn: 1.22.18 - ~/.yarn/bin/yarn
    npm: 10.1.0 - /usr/local/bin/npm
  Browsers:
    Chrome: 129.0.6668.100
    Safari: 18.0

package.json dependencies

No response

Steps to reproduce

index.html:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        {{ message }}<span v-if="cNum">{{ cNum }}</span>
        <div><button @click="test()">Change Message</button></div>
    </div>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/3.5.12/vue.global.prod.min.js"></script>
    <script>
        Vue.createApp({
            data() { 
                return { 
                    message: 'Hello Vue ' 
                }
            },
            computed: {
                cNum() {
                    return 3;
                }
            },
            methods: {
                updateMessage(value) {
                    this.message = value;
                },
                test() {
                    this.updateMessage(this.cNum);
                }
            }
        }).mount('#app');
    </script>
</body>
</html>

Test go to definition: Screenshot 2024-10-12 at 14 05 39

Screenshot 2024-10-12 at 14 05 44

Screenshot 2024-10-12 at 14 06 08

Screenshot 2024-10-12 at 14 13 12

What is expected?

go to definition should work in these cases

What is actually happening?

in .html files (HTML language):