如何在VS代码中更改逗号和括号颜色

Ira*_*kli 4 visual-studio-code

听起来有点愚蠢,但我无法弄清楚如何定位这种类型的文字.在VS Code 1.5中更改逗号,引号,括号等颜色的命令是什么?

非常感谢

Ale*_*lex 15

settings.json Ctrl +,

"editor.tokenColorCustomizations": {
    "textMateRules": [{
        "scope": "punctuation",
        "settings": {
            "foreground": "#ffffff"
        }
    }]
}
Run Code Online (Sandbox Code Playgroud)

https://code.visualstudio.com/docs/extensions/themes-snippets-colorizers#_textmate-theme-rules

https://www.sublimetext.com/docs/3/scope_naming.html


Von*_*onC 12

对于括号,请参阅 VSCode 1.60,2021 年 8 月,其中包括括号对着色作为内置功能。

高性能支架对着色

编辑器现在支持原生括号对着色:

打开和关闭括号对着色的并排比较

可以通过设置 " editor.bracketPairColorization.enabled": true来启用括号对着色。
所有颜色均可主题化,最多可配置六种颜色。

我们实现此功能是为了解决CoenraadS著名的Bracket Pair Colorizer扩展的性能问题。

设置:

 colorCustomizations:

{
  "workbench.colorCustomizations": {

    "editorBracketHighlight.foreground1": "#3700ff",
    "editorBracketHighlight.foreground2": "#66ff00",
    "editorBracketHighlight.unexpectedBracket.foreground": "#ff0000",
  }
}
Run Code Online (Sandbox Code Playgroud)