有人可以向我解释一下如何在 VSCode 的默认主题中为 Python 自定义文档字符串颜色吗?我想通过用户设置进行操作,因为我希望能够保存我的配置文件。
我尝试使用 "editor.tokenColorCustomizations": {} 但它会影响所有字符串。
最佳答案
将此添加到您的设置文件中:
<!-- language: json -->
"editor.tokenColorCustomizations": {
"textMateRules": [
{
"scope":"string.quoted.docstring.multi.python",
"settings": {
"foreground": "#69676c" //change to your preference
}
}
]
}
附加信息:
要找出其他元素的范围,您可以使用命令 Developer: Inspect TM Scopes
,如此处所述 https://github.com/Microsoft/vscode/pull/29393
更多细节: https://code.visualstudio.com/docs/getstarted/themes#_customize-a-color-theme
关于python - 如何在 VSCode 的默认主题中为 Python 自定义文档字符串颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46689334/