visual-studio-code - 如何更改 VS Code 中注释的颜色?

标签 visual-studio-code

我浏览了https://code.visualstudio.com/docs/getstarted/theme-color-reference但似乎找不到更改评论颜色的设置。

我目前正在使用 Atom One Dark 主题,只是想稍微淡化颜色,以便更好地阅读。

最佳答案

来自1.15 (July 2017)您可以将其更改为 settings.json Ctrl+,

"editor.tokenColorCustomizations": {
    "comments": "#d4922f"
},

来自1.20 (January 2018)您也可以分别为每个主题执行此操作:

"editor.tokenColorCustomizations": {
    "[Atom One Dark]": {
        "comments": "#d4922f"
    }
},

或者现在您可以同时指定多个主题的设置,如 "[Atom One Dark][Tomorrow Night Blue]": {...}

找到正确的范围:

要找到正确的范围,您需要打开 token 和范围检查器。按 Ctrl + Shift + P 打开命令面板,然后键入并搜索 Developer: Inspect Editor Tokens and Scopes ,如下所示:

enter image description here

选择它。现在,您可以单击不同的语法来查看语法突出显示范围和信息,如下所示:

enter image description here

完成后,按 Esc 退出标记和范围检查模式。

选择器优先级:

https://code.visualstudio.com/blogs/2017/02/08/syntax-highlighting-optimizations#_textmate-themes

<小时/> <小时/>

好的,更多示例(对于 js):

"editor.tokenColorCustomizations": {
    "textMateRules": [{
        "scope": "INSERT_SCOPE_HERE",
        "settings": {
            "foreground": "#ff0000"
        }
    }]
}

评论 enter image description here punctuation.definition.comment enter image description here comment.block.documentation enter image description here storage.type.class.jsdoc enter image description here entity.name.type.instance.jsdoc enter image description here variable.other.jsdoc enter image description here

关于visual-studio-code - 如何更改 VS Code 中注释的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45195023/

相关文章:

typescript - VS Code 和 Yarn PnP

visual-studio-code - 如何在 VS Code 中安装已弃用的扩展?

angular - vscode : manually recheck for errors/problems (angular 2)

typescript - 如何在 Visual Studio Code 中格式化 Typescript 文档?

angular - 类型 'HTMLElement' 的参数不可分配给类型 'CanvasImageSource' 的参数

visual-studio-code - 无法使用 html 文件将样式应用到 VSCode Webview

c++ - 如何在 Visual Studio Code 中包含编译器标志?

visual-studio-code - 在不安装 Visual Studio 2015 的情况下为 Visual Studio Code 安装 .NET core 1.0.1?

visual-studio-code - VS Code - 键盘滚动后将光标移动到当前屏幕中心的键盘快捷键

typescript - 如何以编程方式更改 VSCode 的语言模式?