作者:昱辰190974945122 | 来源:互联网 | 2023-02-05 14:24
我正在使用Visual Studio Code 1.11.2.我需要能够在任何语言文件中看到斜体的注释,或者至少是Javascript,Python,C,C++.是否存在一般性设置,或者目前我是否可以通过编程方式实现这一目标?
1> Jason..:
谢谢你指出我正确的方向维克多.我想删除某个主题的斜体注释,并将其放入我的设置文件(Visual Studio Code 1.16.0)中.
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "comment",
"settings": {
"fontStyle": "normal"
}
}
]
}
在你的情况,阿曼尼,更换normal
用italic
编辑:似乎有些事情可能会有所改变.
如果规则无法应用,您可以使用Visual Studio Code(≥v1.9)TextMate Scope Inspector Widget轻松找出所需的范围选择器.
要访问它,请按,然后ctrl/cmd + shift + p
查找Developer: Inspect TM Scopes
我目前已将以下内容应用于我settings.json
:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"name": "Comment",
"scope": [
"comment",
"comment.block",
"comment.block.documentation",
"comment.line",
"comment.line.double-slash",
"punctuation.definition.comment",
],
"settings": {
"fontStyle": "",
// "fontStyle": "italic",
// "fontStyle": "italic underline",
// "fontStyle": "italic bold underline",
}
},
]
},
2> Victor Barra..:
是的,有办法实现这一目标.
此答案适用于Microsoft Windows [版本10.0.14393],Visual Studio Code 1.14.2
如果您使用Extension MarketPlace中已安装的主题,则其文件位于 C:\Users\\.vscode\extensions\
假设您正在使用Kal.theme-glacier.主题文件是这样的:
C:\Users\\.vscode\extensions\Kal.theme-glacier-0.0.1\themes\glacier.tmTheme
在任何文本编辑器中编辑文件(建议使用Notepad ++)
编辑主题文件时不应运行Visual Studio代码,或者您可能需要重新启动VS-Code.
找到密钥名称Comment
并更改FontStyle
为italic
.最后一段代码应如下所示:
name
Comment
scope
comment
settings
fontStyle
italic
foreground
#515c68
如果您使用的是默认主题(未从Extension MarketPlace安装),则位置在此处:
C:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\theme-
.
假设您正在使用Light +(默认光照)主题.
您首先要查看的文件是
C:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\theme-defaults\themes\light_plus.json
你会发现这里没有Comment
键,但你会注意到"include": "./light_vs.json"
这是你要编辑的实际文件.
最终块C:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\theme-defaults\themes\light_vs.json
应该如下所示:
{
"scope": "comment",
"settings": {
"foreground": "#009000",
"fontStyle": "italic"
}
},