Skip to content

Commit 3f73386

Browse files
committed
Simplify highlighting queries
1 parent 1b59c77 commit 3f73386

File tree

1 file changed

+5
-22
lines changed

1 file changed

+5
-22
lines changed

Diff for: queries/highlights.scm

+5-22
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
(predefined_type)
2323
] @type.builtin
2424

25+
(_ type: (_) @type)
26+
2527
;; Enum
2628
(enum_member_declaration (identifier) @property.definition)
2729

@@ -187,19 +189,10 @@
187189
(prefix_unary_expression (identifier) @variable)
188190
(postfix_unary_expression (identifier)* @variable)
189191
(assignment_expression (identifier) @variable)
190-
(cast_expression (identifier) @type (identifier) @variable)
192+
(cast_expression value: (identifier) @variable)
191193

192-
;; Class
193-
(base_list (identifier) @type)
194-
(property_declaration (generic_name))
195-
(property_declaration
196-
type: (nullable_type) @type
197-
name: (identifier) @variable)
194+
;; Property
198195
(property_declaration
199-
type: (predefined_type) @type
200-
name: (identifier) @variable)
201-
(property_declaration
202-
type: (identifier) @type
203196
name: (identifier) @variable)
204197

205198
;; Lambda
@@ -210,34 +203,24 @@
210203

211204
;; Parameter
212205
(parameter
213-
type: (identifier) @type
214206
name: (identifier) @variable.parameter)
215-
(parameter (identifier) @variable.parameter)
216207
(parameter_modifier) @keyword
217208

218-
;; Typeof
219-
(type_of_expression (identifier) @type)
220-
221209
;; Variable
222-
(variable_declaration (identifier) @type)
223210
(variable_declarator (identifier) @variable)
224211

225212
;; Return
226213
(return_statement (identifier) @variable)
227214
(yield_statement (identifier) @variable)
228215

229216
;; Type
230-
(generic_name (identifier) @type)
231217
(type_parameter (identifier) @property.definition)
232-
(type_argument_list (identifier) @type)
233218

234219
;; Type constraints
235220
(type_parameter_constraints_clause (identifier) @property.definition)
236-
(type_constraint (identifier) @type)
237221

238222
;; Exception
239-
(catch_declaration (identifier) @type (identifier) @variable)
240-
(catch_declaration (identifier) @type)
223+
(catch_declaration name: (identifier) @variable)
241224

242225
;; Switch
243226
(switch_statement (identifier) @variable)

0 commit comments

Comments
 (0)