php - 无法在 VSCode for PHP 中更改 DocBlock 注释颜色
问题描述
我到处看了看,但没有运气。我的 VS Code 主题中的 DocBlock 注释有 3 种不同的颜色(见截图)。我希望这一切都是灰色的(只有一种颜色)。我意识到这取决于主题本身(我正在使用Atom One Dark
)。我该如何更改它以使评论文本为一种颜色(灰色)?
我可以使用此设置更改 javascript 的 DockBlock 注释,但它仅适用javascript
于PHP
.
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"name": "storage.type.class.jsdoc",
"scope":
"storage.type.class.jsdoc,entity.name.type.instance.jsdoc,variable.other.jsdoc",
"settings": {
"foreground": "#5c6370"
}
}
],
},
这也不起作用
"editor.tokenColorCustomizations": {
"comments": "#5c6370",
},
屏幕截图(如您所见,我的评论有 3 种颜色 - 灰色、紫色和黄色)
解决方案
感谢@rioV8,我能够完全实现我想要的。settings.json
因此,如果其他人正在寻找解决方案,我将分享我的。
我还了解到,您可以通过用空格分隔多个范围来选择它们。但是顺序很重要,看起来需要与检查编辑器显示的顺序相反。去搞清楚..
这是我的settings.json
(用于 javascript 和 PHP 评论)
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "storage.type.class.jsdoc,entity.name.type.instance.jsdoc,variable.other.jsdoc",
"settings": {
"foreground": "#485c6c"
}
},
{
"scope": "storage.type.class.jsdoc punctuation.definition.block.tag.jsdoc",
"settings": {
"foreground": "#485c6c"
}
},
{
"scope": "comment.block.documentation.phpdoc.php",
"settings": {
"foreground": "#5c6370"
}
},
{
"scope": "keyword.other.phpdoc.php,comment.block.documentation.phpdoc.php",
"settings": {
"foreground": "#76687d"
}
},
{
"scope": "keyword.other.type.php,meta.other.type.phpdoc.php,comment.block.documentation.phpdoc.php",
"settings": {
"foreground": "#76687d"
}
},
{
"scope": "support.class.php",
"settings": {
"foreground": "#E5C07B"
}
},
{
"scope": "meta.other.type.phpdoc.php,comment.block.documentation.phpdoc.php",
"settings": {
"foreground": "#5c6370"
}
},
{
"scope": "meta.other.type.phpdoc.php support.class.php",
"settings": {
"foreground": "#5c6370"
}
},
{
"scope": "meta.other.type.phpdoc.php support.class.builtin.php",
"settings": {
"foreground": "#5c6370"
}
},
],
}
推荐阅读
- android - 无法构建发布 Flutter APK
- html - 如何使用 Swiper.js 在容器内显示幻灯片(至少最后一张幻灯片)
- fastapi - Tortoise 和 Fastapi 获取相关资源
- flutter - 如何在扫描条码时显示进度指示器
- python - pygame.sprite.LayeredUpdates.move_to_front() 不起作用
- javascript - 导入前过滤谷歌表格导入数据
- javascript - JSX 不接受三元语句(意外标记“?”)
- r - R从括号内的字符串中提取多个数字正则表达式
- sql - 我可以从 Terraform 脚本填充数据库吗(对于 GCP)
- google-kubernetes-engine - 带有自定义 SSL 证书的 Traefik 2.3 将不起作用