on f1b9c19 help sign in
helix/runtime/queries/java/highlights.scm
224 lines 2.7 kB history raw
1; Methods
3(method_declaration
4 name: (identifier) @function.method)
5(method_invocation
6 name: (identifier) @function.method)
7(super) @function.builtin
9; Annotations
11(annotation
12 name: (identifier) @attribute)
13(marker_annotation
14 name: (identifier) @attribute)
16; Types
18(interface_declaration
19 name: (identifier) @type)
20(class_declaration
21 name: (identifier) @type)
22(record_declaration
23 name: (identifier) @type)
24(enum_declaration
25 name: (identifier) @type)
27((field_access
28 object: (identifier) @type)
29 (#match? @type "^[A-Z]"))
30((scoped_identifier
31 scope: (identifier) @type)
32 (#match? @type "^[A-Z]"))
34(constructor_declaration
35 name: (identifier) @type)
36(compact_constructor_declaration
37 name: (identifier) @type)
39(type_identifier) @type
42 (boolean_type)
43 (integral_type)
44 (floating_point_type)
45 (floating_point_type)
46 (void_type)
47] @type.builtin
49(type_arguments
50 (wildcard "?" @type.builtin))
52; Variables
54((identifier) @constant
55 (#match? @constant "^_*[A-Z][A-Z\\d_]+$"))
57(identifier) @variable
59(this) @variable.builtin
61; Literals
64 (hex_integer_literal)
65 (decimal_integer_literal)
66 (octal_integer_literal)
67 (binary_integer_literal)
68] @constant.numeric.integer
71 (decimal_floating_point_literal)
72 (hex_floating_point_literal)
73] @constant.numeric.float
75(character_literal) @constant.character
78 (string_literal)
79 (text_block)
80] @string
83 (true)
84 (false)
85 (null_literal)
86] @constant.builtin
88(line_comment) @comment
89(block_comment) @comment
91; Punctuation
94 "::"
95 "."
96 ";"
97 ","
98] @punctuation.delimiter
101 "@"
102 "..."
103] @punctuation.special
106 "("
107 ")"
108 "["
109 "]"
110 "{"
111 "}"
112] @punctuation.bracket
114(type_arguments
115 [
116 "<"
117 ">"
118 ] @punctuation.bracket)
120(type_parameters
121 [
122 "<"
123 ">"
124 ] @punctuation.bracket)
126; Operators
129 "="
130 ">"
131 "<"
132 "!"
133 "~"
134 "?"
135 ":"
136 "->"
137 "=="
138 ">="
139 "<="
140 "!="
141 "&&"
142 "||"
143 "++"
144 "--"
145 "+"
146 "-"
147 "*"
148 "/"
149 "&"
150 "|"
151 "^"
152 "%"
153 "<<"
154 ">>"
155 ">>>"
156 "+="
157 "-="
158 "*="
159 "/="
160 "&="
161 "|="
162 "^="
163 "%="
164 "<<="
165 ">>="
166 ">>>="
167] @operator
169; Keywords
172 "abstract"
173 "assert"
174 "break"
175 "case"
176 "catch"
177 "class"
178 "continue"
179 "default"
180 "do"
181 "else"
182 "enum"
183 "exports"
184 "extends"
185 "final"
186 "finally"
187 "for"
188 "if"
189 "implements"
190 "import"
191 "instanceof"
192 "interface"
193 "module"
194 "native"
195 "new"
196 "non-sealed"
197 "open"
198 "opens"
199 "package"
200 "permits"
201 "private"
202 "protected"
203 "provides"
204 "public"
205 "requires"
206 "record"
207 "return"
208 "sealed"
209 "static"
210 "strictfp"
211 "switch"
212 "synchronized"
213 "throw"
214 "throws"
215 "to"
216 "transient"
217 "transitive"
218 "try"
219 "uses"
220 "volatile"
221 "while"
222 "with"
223 "yield"
224] @keyword