[英]Change comment and block comment colors separately in VS code
I'm trying to find out how to specify one color for single-line comment and another for block comment (multi-line).我试图找出如何为单行注释指定一种颜色,为块注释(多行)指定另一种颜色。
The below works for setting ALL comments to a certain color:以下适用于将所有评论设置为某种颜色:
"editor.tokenColorCustomizations": {
"comments" :"#ff0022",
}
Is there a way to specify them individually?有没有办法单独指定它们? eg
"blockComment": "#00FF00", "commentLine": "#FF00222"
例如
"blockComment": "#00FF00", "commentLine": "#FF00222"
Use "textMateRules"
to set scope settings for "comment.block"
and "comment.line"
can set the colors individually.使用
"textMateRules"
设置"comment.block"
和"comment.line"
的scope设置可以单独设置colors。
"editor.tokenColorCustomizations": {
"textMateRules": [{
"scope": "comment.block",
"settings": {
"foreground": "#0000"
}
},
{
"scope": "comment.line",
"settings": {
"foreground": "#0000FF"
}
}],
}
To change punctuations "punctuation.definition.comment.js"
(js):要更改标点符号
"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.