繁体   English   中英

在VS代码中分别更改注释和块注释colors

[英]Change comment and block comment colors separately in VS code

我试图找出如何为单行注释指定一种颜色,为块注释(多行)指定另一种颜色。

以下适用于将所有评论设置为某种颜色:

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

有没有办法单独指定它们? 例如"blockComment": "#00FF00", "commentLine": "#FF00222"

使用"textMateRules"设置"comment.block""comment.line"的scope设置可以单独设置colors。

"editor.tokenColorCustomizations": {
    "textMateRules": [{
        "scope": "comment.block",
        "settings": {
            "foreground": "#0000"
        }
    },
    {
        "scope": "comment.line",
        "settings": {
            "foreground": "#0000FF"
        }
    }],
}

Javascript

要更改标点符号"punctuation.definition.comment.js" (js):

"editor.tokenColorCustomizations": {
    "textMateRules": [{
        "scope": "comment.line, punctuation.definition.comment.js",
        "settings": {
            "foreground": "#00FF00"
        }
    }]
}

在此处输入图像描述

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM