on master help sign in
Update gdscript highlight (#6311)
64c137bErasin Wang
runtime/queries/gdscript/highlights.scm+27−4
@@ -17,8 +17,11 @@
17
17
18; Function definitions
18; Function definitions
19
19
20−(function_definition (name) @function)
20+(function_definition
21+ name: (name) @function
22+ parameters: (parameters) @variable.parameter )
21(constructor_definition "_init" @function)
23(constructor_definition "_init" @function)
24+(lambda (parameters) @variable.parameter)
22
25
23
26
24;; Literals
27;; Literals
@@ -28,9 +31,28 @@
28(type) @type
31(type) @type
29(expression_statement (array (identifier) @type))
32(expression_statement (array (identifier) @type))
30(binary_operator (identifier) @type)
33(binary_operator (identifier) @type)
34+(enum_definition (name) @type.enum)
35+(enumerator (identifier) @type.enum.variant)
36+[
37+ (null)
38+ (underscore)
39+] @type.builtin
40+
31
41
32(variable_statement (identifier) @variable)
42(variable_statement (identifier) @variable)
43+(attribute
44+ (identifier)
45+ (identifier) @variable.other.member)
46+(attribute
47+ (identifier) @type.builtin
48+ (#match? @type.builtin "^(AABB|Array|Basis|bool|Callable|Color|Dictionary|float|int|NodePath|Object|Packed(Byte|Color|String)Array|PackedFloat(32|64)Array|PackedInt(32|64)Array|PackedVector(2|3)Array|Plane|Projection|Quaternion|Rect2([i]{0,1})|RID|Signal|String|StringName|Transform(2|3)D|Variant|Vector(2|3|4)([i]{0,1}))$"))
49+
50+[
51+ (string_name)
52+ (node_path)
33−(get_node) @label
53+ (get_node)
54+] @label
55+(signal_statement (name) @label)
34
56
35(const_statement (name) @constant)
57(const_statement (name) @constant)
36(integer) @constant.numeric.integer
58(integer) @constant.numeric.integer
@@ -40,7 +62,6 @@
40 (true)
62 (true)
41 (false)
63 (false)
42] @constant.builtin.boolean
64] @constant.builtin.boolean
43−(null) @constant.builtin
44
65
45[
66[
46 "+"
67 "+"
@@ -66,6 +87,7 @@
66 "~"
87 "~"
67 "<<"
88 "<<"
68 ">>"
89 ">>"
90+ ":="
69] @operator
91] @operator
70
92
71(annotation (identifier) @keyword.storage.modifier)
93(annotation (identifier) @keyword.storage.modifier)
@@ -74,6 +96,7 @@
74 "if"
96 "if"
75 "else"
97 "else"
76 "elif"
98 "elif"
99+ "match"
77] @keyword.control.conditional
100] @keyword.control.conditional
78
101
79[
102[
@@ -100,7 +123,6 @@
100 "in"
123 "in"
101 "is"
124 "is"
102 "as"
125 "as"
103− "match"
104 "and"
126 "and"
105 "or"
127 "or"
106 "not"
128 "not"
@@ -128,5 +150,6 @@
128 "extends"
150 "extends"
129 "set"
151 "set"
130 "get"
152 "get"
153+ "await"
131] @keyword
154] @keyword
132
155