我试图改变C中结构中变量的颜色。特别是(*stack_a)->sorted_pos
成员(请参阅附图)。我想把这些变量的粉红色变成橙子。
(picture example of struct variable to be changed)
再举一个简单的例子:
typedef struct { int bar; } Foo;
int baz(Foo* foo) {
return foo->bar; // <- I want to change `bar` here
}
我已经为我的主题(Spaceduck)浏览了.json文件,并试图改变其中的许多变量以找到正确的变量,但没有成功。我还尝试在谷歌上搜索该特定变量的名称(我猜它可能是keyword.struct.variable或类似的东西),但找不到它。
我在哪里可以找到这些信息,或者什么是变量的文本称为?
1条答案
按热度按时间zed5wv101#
您可以在命令面板中使用
Developer: Inspect Editor Tokens and Scopes
来获取有关颜色范围的信息。如果没有任何C语言支持扩展,那么您将使用
variable.other.member.c
和variable.other.property.cpp
TextMate作用域。例如:(将其放入settings.json中)使用Microsoft C/C扩展,您需要使用
variable.other.property.c
和variable.other.property.c
TextMate作用域,这(不幸的是?)适用于成员变量引用及其声明。或者您可以使用"scope": "variable.other.member.c, variable.other.property.c, variable.other.property.cpp",
来处理这两种情况。Microsoft C/C扩展也提供了semantic highlighting,因此您也可以在settings.json中编写类似的内容以获得类似的效果: