【发布时间】:2018-05-23 07:25:57
【问题描述】:
【问题讨论】:
标签: python visual-studio-code syntax-highlighting
【问题讨论】:
标签: python visual-studio-code syntax-highlighting
在你的 settings.json 中试试这个设置:
"editor.tokenColorCustomizations": {
"variables": "#f00"
},
有一些这样的简单标记颜色自定义可用:变量、cmets、关键字、函数、数字、字符串和类型。那些只允许设置 color。
如果您使用“textMateRules”,您可以设置更多属性。例如:
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "comment",
"settings": {
"fontStyle": "italic",
"foreground": "#C69650"
}
}
]
},
【讨论】:
self 变为红色,但 search_obj 不是,get_key 部分也不是,它应该应用函数 - 该函数仅适用于定义.
这对我有用。据我所知,它使它看起来像默认的 Javascript 格式。
在settings.json
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope": "meta.function-call.generic.python",
"settings": {
"foreground": "#DCDCAA"
}
},
{
"scope": "source.python",
"settings": {
"foreground": "#9CDCFE"
}
},
{
"scope": "punctuation.definition.string.begin",
"settings": {
"foreground": "#ce9178"
}
},
{
"scope": "punctuation.definition.string.end",
"settings": {
"foreground": "#ce9178"
}
},
{
"scope": "punctuation",
"settings": {
"foreground": "#dfdfdf"
}
}
]
}
【讨论】:
您应该可以在tokenColors 中添加颜色以自定义颜色(基本示例):
SomeTheme.json
{
"name": "Some Theme",
"type": "dark",
"colors": {
...
},
"tokenColors": [
{
"name": "Variables",
"scope": "variable",
"settings": {
"foreground": "#e06c75"
}
},
]
}
我没有VSCode,虽然从another themes JSON 看起来很相似。
【讨论】:
试试这个:
{
"scope": [
"variable.other.readwrite",
],
"settings": {
"foreground": "#ffffff",
}
},
【讨论】: