我浏览了https://code.visualstudio.com/docs/getstarted/theme-color-reference,但似乎找不到更改注释颜色的设置。
我目前正在使用Atom One Dark主题,只是想把颜色变亮一点,这样我就可以更好地阅读它。
发布于 2019-03-12 10:21:38
转到您的设置。
然后搜索settings.json
打开文件,然后添加以下代码行:
"editor.tokenColorCustomizations": {
"comments": "#229977"
},
根据您的喜好更改注释的颜色,方法是将鼠标悬停在颜色上并选择所需的颜色。
然后保存更改。(Ctrl+S)退出程序。再次打开它,您将看到更改。
发布于 2021-06-17 02:37:23
在VS代码中: 1.56.2
添加到settings.json
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": [
"comment",
"comment.block.documentation",
"comment.block.documentation.js",
"comment.line.double-slash.js",
"storage.type.class.jsdoc",
"entity.name.type.instance.jsdoc",
"variable.other.jsdoc",
"punctuation.definition.comment",
"punctuation.definition.comment.begin.documentation",
"punctuation.definition.comment.end.documentation"
],
"settings": {
"fontStyle": "italic",
"foreground": "#287a1d"
}
}
]
}
如果仍然缺少stoff:CTRL+SHIFT+P
=> Developer: Inspect Editor Tokens and Scopes
将鼠标悬停在未正确着色的零件上,并将它们添加到"scope"
。
原来你在这儿啊。:)
发布于 2020-07-13 23:46:56
文档、块和行设置
要使文档、块和行注释具有不同的颜色,请执行以下操作:
"editor.tokenColorCustomizations": {
"[Cobalt2]": {
"textMateRules": [
{
"scope": [
"comment.block",
"punctuation.definition.comment.end",
"punctuation.definition.comment.begin"
],
"settings": {
"foreground": "#85b3f8",
"fontStyle": "bold"
}
},
{
"scope": [
"comment.block.documentation",
"punctuation.definition.comment.begin.documentation",
"punctuation.definition.comment.end.documentation"
],
"settings": {
"foreground": "#6bddb7",
"fontStyle": "bold"
}
},{
"scope":["comment.line", "punctuation.definition.comment"],
"settings": {
"foreground": "#FF0000",
"fontStyle": "bold"
}
}
]
}
}
使用C++进行了测试。
https://stackoverflow.com/questions/45195023
复制相似问题