更改 VS Code 中注释周围字符的颜色 [英] Change color of characters surrounding comments in VS Code

查看:53
本文介绍了更改 VS Code 中注释周围字符的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改 vs 代码中注释前后字符的颜色.我在谈论或/* */或 # 字符.我知道如何更改评论颜色

how can I change the color of the characters that come before and after a comment in vs code. Im Talking about or /* */ or # characters. I know how to change the comment color

如何更改评论的颜色在 Visual Studio 代码中?

但找不到关于框架"字符的任何信息.

but couldn’t find anything regarding the „framing" characters.

推荐答案

你可以很简单地做到这一点.使用命令面板中的Inspect TM Scopes"来检查这些字符.它将为每种语言提供不同的范围,例如:

You can do this rather simply. Use "Inspect TM Scopes" in the command palette to inspect those characters. It will give a different scope for each language, something like :

punctuation.definition.comment.js

用于 JavaScript 注释.现在您可以在您的用户设置中使用它,如下所示:

for javascript comments. Now you can use that in your user settings like so:

"editor.tokenColorCustomizations": {
    "textMateRules": [

      {
        "scope": "punctuation.definition.comment.js",
        "settings": {
          "foreground": "#f00",
        }
      }
   ]
}

对于其他语言,您显然会有不同但相似的范围.

You will obviously have a different but similar scope for other languages.

并查看添加到 的简短答案如何使用斜线更改 VisualStudioCode 注释颜色? 关于 可能 计划在 2019 年 10 月版本中修复此问题.所以标点符号不必单独着色.[现在已在 Insider's Build 中修复.]

And see the short answer added to How to change VisualStudioCode comment color with it's slashes? about possible plans to fix this in the October, 2019 release. So the punctuation would not have to be independently colored. [It is now fixed in the Insider's Build.]

这篇关于更改 VS Code 中注释周围字符的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆