on fb14913 help sign in
helix/runtime/queries/java/highlights.scm
145 lines 2.1 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"@" @operator
18; Types
20(interface_declaration
21 name: (identifier) @type)
22(class_declaration
23 name: (identifier) @type)
24(record_declaration
25 name: (identifier) @type)
26(enum_declaration
27 name: (identifier) @type)
29((field_access
30 object: (identifier) @type)
31 (#match? @type "^[A-Z]"))
32((scoped_identifier
33 scope: (identifier) @type)
34 (#match? @type "^[A-Z]"))
36(constructor_declaration
37 name: (identifier) @type)
38(compact_constructor_declaration
39 name: (identifier) @type)
41(type_identifier) @type
44 (boolean_type)
45 (integral_type)
46 (floating_point_type)
47 (floating_point_type)
48 (void_type)
49] @type.builtin
51; Variables
53((identifier) @constant
54 (#match? @constant "^_*[A-Z][A-Z\\d_]+$"))
56(identifier) @variable
58(this) @variable.builtin
60; Literals
63 (hex_integer_literal)
64 (decimal_integer_literal)
65 (octal_integer_literal)
66 (binary_integer_literal)
67] @constant.numeric.integer
70 (decimal_floating_point_literal)
71 (hex_floating_point_literal)
72] @constant.numeric.float
74(character_literal) @constant.character
77 (string_literal)
78 (text_block)
79] @string
82 (true)
83 (false)
84 (null_literal)
85] @constant.builtin
87(line_comment) @comment
88(block_comment) @comment
90; Keywords
93 "abstract"
94 "assert"
95 "break"
96 "case"
97 "catch"
98 "class"
99 "continue"
100 "default"
101 "do"
102 "else"
103 "enum"
104 "exports"
105 "extends"
106 "final"
107 "finally"
108 "for"
109 "if"
110 "implements"
111 "import"
112 "instanceof"
113 "interface"
114 "module"
115 "native"
116 "new"
117 "non-sealed"
118 "open"
119 "opens"
120 "package"
121 "permits"
122 "private"
123 "protected"
124 "provides"
125 "public"
126 "requires"
127 "record"
128 "return"
129 "sealed"
130 "static"
131 "strictfp"
132 "switch"
133 "synchronized"
134 "throw"
135 "throws"
136 "to"
137 "transient"
138 "transitive"
139 "try"
140 "uses"
141 "volatile"
142 "while"
143 "with"
144 "yield"
145] @keyword