如何用它的斜杠更改VisualStudioCode注释颜色?

问题描述 投票:3回答:1

我将此代码添加到我的setting.json中

"editor.tokenColorCustomizations": {
    "comments": "#00ff00"
}

但它不会改变斜杠的颜色,因为你可以看到下面的截图。 它仍然是灰色的。

如何更改整个注释颜色包含斜杠?

enter image description here

visual-studio-code vscode-settings
1个回答
2
投票

可以使用punctuation.definition.comment数组中的textMateRules范围自定义注释定义(//或其他语言的#)。

例:

"editor.tokenColorCustomizations": {
  "[Material Theme Darker High Contrast]": { // optional name of a specific theme
    "textMateRules": [
      {
        "scope": "punctuation.definition.comment",
        "settings": {
          "foreground": "#00ff00"
        }
      }
    ]
  }
}

您可以在命令面板中查看所有命令Inspect TM Scopes的范围。

© www.soinside.com 2019 - 2024. All rights reserved.