|
9 | 9 | (member_access_expression
|
10 | 10 | name: (identifier) @function))
|
11 | 11 |
|
12 |
| -(invocation_expression |
13 |
| - (member_access_expression |
14 |
| - expression: (identifier) @variable)) |
15 |
| - |
16 | 12 | (invocation_expression
|
17 | 13 | function: (conditional_access_expression
|
18 | 14 | (member_binding_expression
|
19 | 15 | name: (identifier) @function)))
|
20 | 16 |
|
21 | 17 | (invocation_expression
|
22 |
| - [(identifier) (qualified_name)] @function) |
| 18 | + [(identifier) (qualified_name)] @function) |
| 19 | + |
| 20 | +(local_function_statement |
| 21 | + name: (identifier) @function) |
23 | 22 |
|
24 | 23 | ; Generic Method invocation with generic type
|
25 | 24 | (invocation_expression
|
26 | 25 | function: (generic_name
|
27 |
| - . (identifier) @function)) |
| 26 | + . (identifier) @function)) |
28 | 27 |
|
29 | 28 | ;; Namespaces
|
30 |
| - |
31 | 29 | (namespace_declaration
|
32 | 30 | name: [(identifier) (qualified_name)] @namespace)
|
33 | 31 |
|
|
40 | 38 | (namespace_declaration name: (identifier) @type)
|
41 | 39 | (using_directive (_) @namespace)
|
42 | 40 | (constructor_declaration name: (identifier) @type)
|
| 41 | +(destructor_declaration name: (identifier) @type) |
43 | 42 | (object_creation_expression [(identifier) (qualified_name)] @type)
|
44 | 43 | (type_parameter_list (type_parameter) @type)
|
| 44 | +(array_type (identifier) @type) |
| 45 | +(for_each_statement type: (identifier) @type) |
45 | 46 |
|
46 | 47 | [
|
47 | 48 | (implicit_type)
|
|
66 | 67 |
|
67 | 68 | (object_creation_expression
|
68 | 69 | (generic_name
|
69 |
| - (identifier) @type)) |
| 70 | + (identifier) @type)) |
70 | 71 |
|
71 | 72 | (property_declaration
|
72 | 73 | (generic_name
|
73 | 74 | (identifier) @type))
|
74 | 75 |
|
75 | 76 | (_
|
76 | 77 | type: (generic_name
|
77 |
| - (identifier) @type)) |
| 78 | + (identifier) @type)) |
78 | 79 |
|
79 | 80 | ;; Enum
|
80 | 81 | (enum_member_declaration (identifier) @variable.other.member)
|
|
91 | 92 | (verbatim_string_literal)
|
92 | 93 | (interpolated_string_text)
|
93 | 94 | (interpolated_verbatim_string_text)
|
| 95 | + (interpolation_format_clause) |
94 | 96 | "\""
|
95 | 97 | "$\""
|
96 | 98 | "@$\""
|
|
150 | 152 | "%"
|
151 | 153 | "%="
|
152 | 154 | ":"
|
| 155 | + "::" |
153 | 156 | ".."
|
154 | 157 | "&="
|
155 | 158 | "->"
|
|
166 | 169 | ] @punctuation.bracket
|
167 | 170 |
|
168 | 171 | ;; Keywords
|
169 |
| -(modifier) @keyword |
| 172 | +(modifier) @keyword.storage.modifier |
170 | 173 | (this_expression) @keyword
|
171 | 174 | (escape_sequence) @constant.character.escape
|
172 | 175 |
|
173 | 176 | [
|
174 | 177 | "as"
|
175 | 178 | "base"
|
176 |
| - "break" |
177 |
| - "case" |
178 | 179 | "catch"
|
179 | 180 | "checked"
|
180 |
| - "class" |
181 |
| - "continue" |
182 |
| - "default" |
183 |
| - "delegate" |
184 |
| - "do" |
185 |
| - "else" |
186 |
| - "enum" |
187 |
| - "event" |
188 |
| - "explicit" |
189 | 181 | "finally"
|
190 |
| - "for" |
191 |
| - "foreach" |
192 |
| - "goto" |
193 |
| - "if" |
194 |
| - "implicit" |
195 |
| - "interface" |
196 | 182 | "is"
|
197 | 183 | "lock"
|
198 |
| - "namespace" |
199 | 184 | "operator"
|
200 | 185 | "params"
|
201 |
| - "return" |
202 | 186 | "sizeof"
|
203 | 187 | "stackalloc"
|
204 |
| - "static" |
205 |
| - "struct" |
206 |
| - "switch" |
207 | 188 | "throw"
|
208 | 189 | "try"
|
209 | 190 | "typeof"
|
210 | 191 | "unchecked"
|
211 | 192 | "using"
|
212 |
| - "while" |
213 | 193 | "new"
|
214 | 194 | "await"
|
215 | 195 | "in"
|
|
222 | 202 | "from"
|
223 | 203 | "where"
|
224 | 204 | "select"
|
225 |
| - "record" |
226 | 205 | "init"
|
227 | 206 | "with"
|
228 | 207 | "let"
|
229 | 208 | ] @keyword
|
230 | 209 |
|
231 |
| -(nullable_directive) @keyword.directive |
232 |
| -(define_directive) @keyword.directive |
233 |
| -(undef_directive) @keyword.directive |
234 |
| -(if_directive) @keyword.directive |
235 |
| -(else_directive) @keyword.directive |
236 |
| -(elif_directive) @keyword.directive |
237 |
| -(endif_directive) @keyword.directive |
238 |
| -(region_directive) @keyword.directive |
239 |
| -(endregion_directive) @keyword.directive |
240 |
| -(error_directive) @keyword.directive |
241 |
| -(warning_directive) @keyword.directive |
242 |
| -(line_directive) @keyword.directive |
243 |
| -(pragma_directive) @keyword.directive |
| 210 | +[ |
| 211 | + "class" |
| 212 | + "delegate" |
| 213 | + "enum" |
| 214 | + "event" |
| 215 | + "interface" |
| 216 | + "namespace" |
| 217 | + "struct" |
| 218 | + "record" |
| 219 | +] @keyword.storage.type |
| 220 | + |
| 221 | +[ |
| 222 | + "explicit" |
| 223 | + "implicit" |
| 224 | + "static" |
| 225 | +] @keyword.storage.modifier |
| 226 | + |
| 227 | +[ |
| 228 | + "for" |
| 229 | + "foreach" |
| 230 | + "do" |
| 231 | + "while" |
| 232 | + "break" |
| 233 | + "continue" |
| 234 | +] @keyword.control.repeat |
| 235 | + |
| 236 | +[ |
| 237 | + "goto" |
| 238 | + "if" |
| 239 | + "else" |
| 240 | + "switch" |
| 241 | + "case" |
| 242 | + "default" |
| 243 | +] @keyword.control.conditional |
| 244 | + |
| 245 | +"return" @keyword.control.return |
| 246 | + |
| 247 | +[ |
| 248 | + (nullable_directive) |
| 249 | + (define_directive) |
| 250 | + (undef_directive) |
| 251 | + (if_directive) |
| 252 | + (else_directive) |
| 253 | + (elif_directive) |
| 254 | + (endif_directive) |
| 255 | + (region_directive) |
| 256 | + (endregion_directive) |
| 257 | + (error_directive) |
| 258 | + (warning_directive) |
| 259 | + (line_directive) |
| 260 | + (pragma_directive) |
| 261 | +] @keyword.directive |
244 | 262 |
|
245 | 263 | ;; Linq
|
246 | 264 | (from_clause (identifier) @variable)
|
|
259 | 277 | (binary_expression [(identifier) (qualified_name)] @variable [(identifier) (qualified_name)] @variable)
|
260 | 278 | (binary_expression [(identifier) (qualified_name)]* @variable)
|
261 | 279 | (conditional_expression [(identifier) (qualified_name)] @variable)
|
| 280 | +(conditional_access_expression [(identifier) (qualified_name)] @variable) |
262 | 281 | (prefix_unary_expression [(identifier) (qualified_name)] @variable)
|
263 | 282 | (postfix_unary_expression [(identifier) (qualified_name)]* @variable)
|
264 | 283 | (assignment_expression [(identifier) (qualified_name)] @variable)
|
265 | 284 | (cast_expression [(identifier) (qualified_name)] @type [(identifier) (qualified_name)] @variable)
|
| 285 | +(element_access_expression (identifier) @variable) |
| 286 | +(member_access_expression |
| 287 | + expression: ([(identifier) (qualified_name)] @type |
| 288 | + (#match? @type "^[A-Z]"))) |
| 289 | +(member_access_expression [(identifier) (qualified_name)] @variable) |
266 | 290 |
|
267 | 291 | ;; Class
|
268 | 292 | (base_list (identifier) @type)
|
|
278 | 302 | name: (identifier) @variable)
|
279 | 303 |
|
280 | 304 | ;; Delegate
|
281 |
| - |
282 | 305 | (delegate_declaration (identifier) @type)
|
283 | 306 |
|
284 | 307 | ;; Lambda
|
|
296 | 319 |
|
297 | 320 | (parameter_list
|
298 | 321 | (parameter
|
299 |
| - name: (identifier) @parameter)) |
| 322 | + name: (identifier) @parameter)) |
300 | 323 |
|
301 | 324 | (parameter_list
|
302 | 325 | (parameter
|
303 |
| - type: [(identifier) (qualified_name)] @type)) |
| 326 | + type: [(identifier) (qualified_name)] @type)) |
304 | 327 |
|
305 | 328 | ;; Typeof
|
306 | 329 | (type_of_expression [(identifier) (qualified_name)] @type)
|
|
315 | 338 |
|
316 | 339 | ;; Type
|
317 | 340 | (generic_name (identifier) @type)
|
318 |
| -(type_parameter [(identifier) (qualified_name)] @variable.parameter) |
| 341 | +(type_parameter [(identifier) (qualified_name)] @type) |
319 | 342 | (type_argument_list [(identifier) (qualified_name)] @type)
|
320 | 343 |
|
321 | 344 | ;; Type constraints
|
|
333 | 356 | ;; Lock statement
|
334 | 357 | (lock_statement (identifier) @variable)
|
335 | 358 |
|
| 359 | +;; Declaration expression |
| 360 | +(declaration_expression |
| 361 | + type: (identifier) @type |
| 362 | + name: (identifier) @variable) |
| 363 | + |
336 | 364 | ;; Rest
|
337 |
| -(member_access_expression) @variable |
338 |
| -(element_access_expression (identifier) @variable) |
339 | 365 | (argument (identifier) @variable)
|
| 366 | +(name_colon (identifier) @variable) |
| 367 | +(if_statement (identifier) @variable) |
340 | 368 | (for_statement (identifier) @variable)
|
341 | 369 | (for_each_statement (identifier) @variable)
|
342 | 370 | (expression_statement (identifier) @variable)
|
343 |
| -(member_access_expression expression: (identifier) @variable) |
344 |
| -(member_access_expression name: (identifier) @variable) |
345 |
| -(conditional_access_expression [(identifier) (qualified_name)] @variable) |
| 371 | +(array_rank_specifier (identifier) @variable) |
| 372 | +(equals_value_clause (identifier) @variable) |
| 373 | +(interpolation (identifier) @variable) |
| 374 | +(cast_expression (identifier) @variable) |
346 | 375 | ((identifier) @comment.unused
|
347 |
| - (#eq? @comment.unused "_")) |
| 376 | + (#eq? @comment.unused "_")) |
0 commit comments