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

vscode go to definition not working in HTML language #4920

Open
tidus2102 opened this issue Oct 12, 2024 · 1 comment
Open

vscode go to definition not working in HTML language #4920

tidus2102 opened this issue Oct 12, 2024 · 1 comment

Comments

@tidus2102
Copy link

tidus2102 commented Oct 12, 2024

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):

  • in html: go to definition NOT working with vue data, computed, methods
  • in <script> tag: go to definition NOT working with vue computed; test with vue data: go to definition works but it doesn't jump to vue data section

Link to minimal reproduction

No response

Any additional comments?

No response

@KazariEX
Copy link
Collaborator

Currently, files other than SFC are not supported.

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

2 participants