on 0b8a00a help sign in
helix/runtime/queries/java/highlights.scm
130 lines 1.8 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(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)
37(type_identifier) @type
40 (boolean_type)
41 (integral_type)
42 (floating_point_type)
43 (floating_point_type)
44 (void_type)
45] @type.builtin
47; Variables
49((identifier) @constant
50 (#match? @constant "^_*[A-Z][A-Z\\d_]+$"))
52(identifier) @variable
54(this) @variable.builtin
56; Literals
59 (hex_integer_literal)
60 (decimal_integer_literal)
61 (octal_integer_literal)
62] @constant.numeric.integer
65 (decimal_floating_point_literal)
66 (hex_floating_point_literal)
67] @constant.numeric.float
69(character_literal) @constant.character
70(string_literal) @string
73 (true)
74 (false)
75 (null_literal)
76] @constant.builtin
78(comment) @comment
80; Keywords
83 "abstract"
84 "assert"
85 "break"
86 "case"
87 "catch"
88 "class"
89 "continue"
90 "default"
91 "do"
92 "else"
93 "enum"
94 "exports"
95 "extends"
96 "final"
97 "finally"
98 "for"
99 "if"
100 "implements"
101 "import"
102 "instanceof"
103 "interface"
104 "module"
105 "native"
106 "new"
107 "open"
108 "opens"
109 "package"
110 "private"
111 "protected"
112 "provides"
113 "public"
114 "requires"
115 "return"
116 "static"
117 "strictfp"
118 "switch"
119 "synchronized"
120 "throw"
121 "throws"
122 "to"
123 "transient"
124 "transitive"
125 "try"
126 "uses"
127 "volatile"
128 "while"
129 "with"
130] @keyword