vuejs / vetur

Vue tooling for VS Code.
https://vuejs.github.io/vetur/
MIT License
5.75k stars 593 forks source link

Unable to comment on a single line inside a vue file #3717

Open ladyruo opened 6 months ago

ladyruo commented 6 months ago

VS Code Version:Version: 1.87.2 (user setup) Commit: https://github.com/microsoft/vscode/commit/863d2581ecda6849923a2118d93a088b0745d9d6 Date: 2024-03-08T15:20:17.278Z Electron: 27.3.2 ElectronBuildId: 26836302 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0

OS Version: Windows_NT x64 10.0.19045

Steps to Reproduce:

When I first opened vscode, I couldn't comment on a single line in the .vue file, I disabled all the plugins and it still didn't work, and I made sure my shortcuts were correct. I don't have any problem with single line comments in .html, when I comment a line of code in .html and then go back to .vue, the single line comments in the .vue file work again!

ladyruo commented 6 months ago

I have a Vue file like this, cmd+/ does nothing if I'm in an html or css region

<template>
    <div>
        <h1>{{ message }}</h1>
        <button @click="changeMessage">Change Message</button>
    </div>
</template>

<script>
export default {
    data() {
        return {
            message: 'Hello, Vue!'
        }
    },
    methods: {
        changeMessage() {
            this.message = 'Message changed!'
        }
    }
}
</script>

<style scoped>
h1 {
    color: #42b983;
}
</style>