|
1 | 1 | ; Methods |
2 | 2 |
|
3 | | -(method_declaration |
4 | | - name: (identifier) @function.method) |
5 | | -(method_invocation |
6 | | - name: (identifier) @function.method) |
| 3 | +(package_declaration (scoped_identifier (identifier) @constant)) |
| 4 | + |
| 5 | +((identifier) @constant (.match? @constant "^[A-Z_][A-Z_\\d]*$")) |
| 6 | +(scoped_identifier (identifier) @type (.match? @type "^[A-Z]") ) |
| 7 | +(scoped_identifier (scoped_identifier) @constant) |
| 8 | +(scoped_identifier (identifier) @property) |
| 9 | + |
| 10 | +(field_access ( identifier ) @type (.match? @type "^[A-Z]")) |
| 11 | +(field_access ( identifier ) @property) |
| 12 | + |
| 13 | +(formal_parameter (identifier) @variable.parameter) |
| 14 | +(method_declaration name: (identifier) @function.method) |
7 | 15 | (super) @function.builtin |
8 | 16 |
|
9 | 17 | ; Annotations |
10 | 18 |
|
11 | | -(annotation |
12 | | - name: (identifier) @attribute) |
13 | | -(marker_annotation |
14 | | - name: (identifier) @attribute) |
| 19 | +(annotation (identifier) @constructor) |
| 20 | +(marker_annotation (identifier) @constructor) |
| 21 | + |
| 22 | +"@" @constant |
15 | 23 |
|
16 | | -"@" @operator |
| 24 | +(annotation_argument_list (element_value_pair (identifier) @variable.parameter)) |
17 | 25 |
|
18 | 26 | ; Types |
19 | 27 |
|
20 | | -(interface_declaration |
21 | | - name: (identifier) @type) |
22 | | -(class_declaration |
23 | | - name: (identifier) @type) |
24 | | -(enum_declaration |
25 | | - name: (identifier) @type) |
| 28 | +(interface_declaration (identifier) @type) |
| 29 | +(class_declaration (identifier) @type) |
| 30 | +(enum_declaration (identifier) @type) |
26 | 31 |
|
27 | | -((scoped_identifier |
28 | | - scope: (identifier) @type) |
29 | | - (.match? @type "^[A-Z]")) |
30 | 32 |
|
31 | | -(constructor_declaration |
32 | | - name: (identifier) @type) |
| 33 | +(constructor_declaration (identifier) @constructor) |
33 | 34 |
|
34 | 35 | (type_identifier) @type |
| 36 | +(variable_declarator (identifier) @constant) |
35 | 37 | (boolean_type) @type.builtin |
36 | 38 | (integral_type) @type.builtin |
37 | 39 | (floating_point_type) @type.builtin |
38 | 40 | (void_type) @type.builtin |
39 | 41 |
|
40 | 42 | ; Variables |
41 | 43 |
|
42 | | -((identifier) @constant |
43 | | - (.match? @constant "^[A-Z_][A-Z_\\d]*$")) |
44 | 44 |
|
45 | 45 | (this) @variable.builtin |
46 | 46 |
|
|
53 | 53 | (hex_floating_point_literal) @number |
54 | 54 | (character_literal) @string |
55 | 55 | (string_literal) @string |
56 | | -(true) @constant.builtin |
57 | | -(false) @constant.builtin |
| 56 | +(true) @constant |
| 57 | +(false) @constant |
58 | 58 | (null_literal) @constant.builtin |
59 | 59 |
|
60 | 60 | (line_comment) @comment |
|
109 | 109 | "volatile" @keyword |
110 | 110 | "while" @keyword |
111 | 111 | "with" @keyword |
| 112 | +"=" @operator |
| 113 | +"==" @operator |
| 114 | +"!" @operator |
| 115 | +"->" @operator |
| 116 | +"?" @operator |
| 117 | +":" @operator |
| 118 | +"::" @operator |
| 119 | +"&&" @operator |
| 120 | + |
| 121 | +[ |
| 122 | + "(" |
| 123 | + ")" |
| 124 | + "{" |
| 125 | + "}" |
| 126 | + "[" |
| 127 | + "]" |
| 128 | + ] @punctuation.bracket |
| 129 | + |
| 130 | +(lambda_expression (identifier) @variable.parameter) |
| 131 | +(((method_invocation (identifier) @type)) . (.match? @type "^[A-Z]")) |
| 132 | +(method_invocation ( argument_list ( identifier ) @constant)) |
| 133 | + |
| 134 | +(method_invocation name: (identifier) @function.call) |
| 135 | + |
| 136 | +((identifier) @constant (.match? @constant "^[A-Z_][A-Z_\\d]*$")) |
0 commit comments