Syntax 如何更改VS代码中区域/结束区域的颜色?

Syntax 如何更改VS代码中区域/结束区域的颜色?,syntax,visual-studio-code,customization,Syntax,Visual Studio Code,Customization,有人知道如何改变#region/#endregion的颜色吗?这在VS社区中是灰色的,但在VS代码中不是 提前感谢。因为术语#region/#endregion是注释的一部分,所以使用命令Developer:Inspect TM scopes查看它们的范围时,只会给您一个注释范围,因此如果您通过以下标记更改注释范围: "editor.tokenColorCustomizations": { "comments": "#ffa600b0" } 将更改所有评论-可能不是您想要的。此外,您只

有人知道如何改变#region/#endregion的颜色吗?这在VS社区中是灰色的,但在VS代码中不是

提前感谢。

因为术语#region/#endregion是注释的一部分,所以使用命令
Developer:Inspect TM scopes
查看它们的范围时,只会给您一个
注释
范围,因此如果您通过以下标记更改注释范围:

"editor.tokenColorCustomizations": {
    "comments": "#ffa600b0"
}
将更改所有评论-可能不是您想要的。此外,您只能在此处更改fontColor和fontStyle(如斜体)

更好的方法是通过正则表达式使用扩展来查找要突出显示的内容

使用
/#region
-您的语言在开始时可能有不同的注释指示符。如果是,请修改下面的第一个捕获组
(//\\s*)

  "highlight.regexes": {

    "(//\\s*)(#region|#endregion)": [

      // the first capture group, the '//' uncolored here, but must have the entry below
      //  you could color those separately if you wish
      {},

      // capture group: #region or #endregion
      {
        // "overviewRulerColor": "#ffcc00",
        "backgroundColor": "#f00",
        "color": "#fff",
        // "fontWeight": "bold",
        "borderRadius": "3px",
      },
    ]
  }

我明白了,很遗憾你不能单独定制。谢谢你的帮助!如何更改区域名称颜色和注释//注释语法是什么样的?