请参阅下面的更新!
似乎我找到了一个临时解决方案。转到此文件夹(如果您使用的是 Mac)/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/theme-monokai/themes 并将此代码放入 monokai-color-theme .json 文件:
{
"name": "Function call",
"scope": "meta.function-call.generic",
"settings": {
"foreground": "#66d9efff"
}
},
这是一个示例:
screenshot
但请记住,主题更新后这些更改可能会消失!
更新:
在突出显示遇到了一些麻烦之后,我决定将带有主题的文件上传到 GitHub 并保持最新状态。因此,如果您不想深入研究代码,只需查看我的存储库:https://github.com/spyker77/monokai-theme-extended
更新(2021 年 4 月)
事实证明,以前的解决方案是不可持续的。因此,目前更好的可能是:
- 在 Visual Studio Code 中,转到“代码”=>“首选项”=>“颜色主题”并选择 Monokai;
- 打开
settings.json文件(how-to);
- 其中可能已经有很多设置,所以您只需在末尾和右大括号之前添加以下自定义项(不要忘记在您继续最后一个设置之后的尾随逗号) :
"editor.tokenColorCustomizations": {
"[Monokai]": {
"textMateRules": [
{
"name": "Decorator definition decorator",
"scope": "punctuation.definition.decorator.python",
"settings": {
"foreground": "#F92672"
}
},
{
"name": "Meta function-call",
"scope": "meta.function-call.generic.python",
"settings": {
"foreground": "#66D9EF"
}
},
{
"name": "Storage type function async",
"scope": "storage.type.function.async.python",
"settings": {
"foreground": "#F92672",
}
},
{
"name": "Punctuation separator period",
"scope": "punctuation.separator.period.python",
"settings": {
"foreground": "#F8F8F2",
}
},
{
"name": "Entity name function decorator",
"scope": "entity.name.function.decorator.python",
"settings": {
"foreground": "#66D9EF",
}
},
{
"name": "Entity name type class",
"scope": "entity.name.type.class.python",
"settings": {
"fontStyle": ""
}
},
{
"name": "Entity other inherited-class",
"scope": "entity.other.inherited-class.python",
"settings": {
"fontStyle": "italic"
}
},
{
"name": "Support type python",
"scope": "support.type.python",
"settings": {
"fontStyle": ""
}
},
{
"name": "String quoted docstring multi python",
"scope": "string.quoted.docstring.multi.python",
"settings": {
"foreground": "#88846F",
}
}
]
}
}