最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

css - In Vue SFC (.vue) files, is the comment style in the <style> tag determined by vue.volar? - Stack Overflow

programmeradmin2浏览0评论

If I create a .vue file in a VS Code that has no plugins installed,

VS Code cannot recognize the file and cannot perform commenting.

However, after installing the vue.volar plugin,

it uses the // symbol for comments in <style lang='scss' scope>.

I think it should be follow CSS_syntax-Comments,I want to use /* */ when pressed ctrl +/

Environment:

Version: 1.98.2 (system setup)
Commit: ddc367ed5c8936efe395cffeec279b04ffd7db78
Date: 2025-03-12T13:32:45.399Z
Electron: 34.2.0
ElectronBuildId: 11161602
Chromium: 132.0.6834.196
Node.js: 20.18.2
V8: 13.2.152.36-electron.0
OS: Windows_NT x64 10.0.26100

If I create a .vue file in a VS Code that has no plugins installed,

VS Code cannot recognize the file and cannot perform commenting.

However, after installing the vue.volar plugin,

it uses the // symbol for comments in <style lang='scss' scope>.

I think it should be follow CSS_syntax-Comments,I want to use /* */ when pressed ctrl +/

Environment:

Version: 1.98.2 (system setup)
Commit: ddc367ed5c8936efe395cffeec279b04ffd7db78
Date: 2025-03-12T13:32:45.399Z
Electron: 34.2.0
ElectronBuildId: 11161602
Chromium: 132.0.6834.196
Node.js: 20.18.2
V8: 13.2.152.36-electron.0
OS: Windows_NT x64 10.0.26100
Share Improve this question edited Apr 1 at 7:54 hellorayza asked Mar 31 at 8:25 hellorayzahellorayza 751 silver badge9 bronze badges 5
  • So, what is the issue exactly? What do you want to achieve? – kissu Commented Mar 31 at 13:15
  • Sorry.I’m being a bit process-oriented. I’ve already clarified the ultimate goal. – hellorayza Commented Apr 1 at 0:16
  • 1 That should work well if you select Vue as the LSP + don't use anything special like lang="scss". We'd need a bit more context from your side to help us narrow it down further. – kissu Commented Apr 1 at 7:25
  • Yes, the comment style changes when lang='scss' is used. Do I need to install a specific plugin? – hellorayza Commented Apr 1 at 8:02
  • 2 Does it work differently if you use multiline comment? stackoverflow/questions/34316156/… // is totally expected in sass for single line comments because it follows the same convention as js, they are allowed because sass is an extension over css – Estus Flask Commented Apr 1 at 23:47
Add a comment  | 

1 Answer 1

Reset to default 0

In VSC, Open Settings (Ctrl + ,).

Search for editor.languagement.

Click Edit in settings.json and add:

"[scss]": {
    "editorments.insertSpace": true,
    "editorments.blockComment": ["/*", "*/"]
}

Save and restart VSC.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论