visual-studio-code - 在 VS 代码中分别更改注释和阻止注释颜色
问题描述
我试图找出如何为单行注释指定一种颜色,为块注释(多行)指定另一种颜色。
以下适用于将所有评论设置为某种颜色:
"editor.tokenColorCustomizations": {
"comments" :"#ff0022",
}
有没有办法单独指定它们?例如"blockComment" : "#00FF00", "commentLine" : "#FF00222"
解决方案
用于"textMateRules"
设置范围设置,"comment.block"
并可"comment.line"
单独设置颜色。
"editor.tokenColorCustomizations": {
"textMateRules": [{
"scope": "comment.block",
"settings": {
"foreground": "#0000"
}
},
{
"scope": "comment.line",
"settings": {
"foreground": "#0000FF"
}
}],
}
要更改标点符号"punctuation.definition.comment.js"
(js):
"editor.tokenColorCustomizations": {
"textMateRules": [{
"scope": "comment.line, punctuation.definition.comment.js",
"settings": {
"foreground": "#00FF00"
}
}]
}
推荐阅读
- json - 如何在 Angular 中将嵌套的 json 对象读取到表中?
- fortran - Fortran 中 (1) 的赋值中不兼容的等级 0 和 1
- css - 当我调整窗口 CSS 大小时,图像与文本重叠
- javascript - 将模块和命名空间添加到同一 TS 声明文件时出现问题
- python - AttributeError:模块“librosa”没有属性“输出”
- java - 在 Spring JPA 中避免 SQL 注入
- python - 为什么命名python文件“.py”没有突出显示
- c - 如何使用 fprintf 将缓冲区内容写入/保存到 C 中的文件
- hangfire - abp.io + hangfire 问题找不到适合 XXXX 类型的构造函数
- reactjs - React Auto Complete 值问题