visual-studio-code - VSCode 颜色主题方法调用
问题描述
我正在尝试更改 VSCode 中的方法调用颜色。我知道我可以更改功能范围颜色,如下所示:
{
"name": "Function call",
"scope": "meta.function-call.object",
"settings": {
"foreground": "#e26f60"
}
}
方法调用是否有等价物。我只想突出显示以下代码中的foo_method ():
class Foo():
def foo_method(self):
print("Called Foo from class")
foo_object = Foo()
foo_object.foo_method()
解决方案
方法调用的范围foo_method
是:
meta.function-call.generic.python
meta.function-call.python
meta.member.access.python
source.python
因此,仅针对方法,请尝试在您的主题中使用更具体的范围选择器。例如,meta.member.access meta.function-call
将选择meta.function-call
范围下的所有meta.member.access
范围:
{
"name": "Function call",
"scope": "meta.member.access meta.function-call",
"settings": {
"foreground": "#e26f60"
}
}
(您可能需要根据您的具体需求进一步调整范围选择器)
推荐阅读
- sapui5 - 表刷新后未调用格式化程序
- html - 为什么背景颜色不适用于 DIV 容器?
- sql - 需要计算每天的罐装总量
- json - 由于 json 和字典中的参数格式错误,Swift-Alamofire 请求失败
- python - 如何使用带有 python 的正则表达式从 XML 文件中删除多个空格和字符?
- python - 当我更改我的 css 代码时如何重新加载烧瓶服务器?
- git - Git克隆错误消息“永久添加到已知主机列表”
- android - 我将使用 React Native 开发一个简单的帐户处理移动应用程序,为此我应该使用什么数据库?
- angular - 如何在 Angular 7 中使用反应式表单设置“至少应填写一个字段”验证?
- javascript - 有没有办法在 Discord.js 中制作频道表情?