on master help sign in
Highlight query improvements for java and typescript (#7145)
86ef389Gammut
runtime/queries/java/highlights.scm+81−2
@@ -13,8 +13,6 @@
13(marker_annotation
13(marker_annotation
14 name: (identifier) @attribute)
14 name: (identifier) @attribute)
15
15
16−"@" @operator
17−
18; Types
16; Types
19
17
20(interface_declaration
18(interface_declaration
@@ -48,6 +46,9 @@
48 (void_type)
46 (void_type)
49] @type.builtin
47] @type.builtin
50
48
49+(type_arguments
50+ (wildcard "?" @type.builtin))
51+
51; Variables
52; Variables
52
53
53((identifier) @constant
54((identifier) @constant
@@ -87,6 +88,84 @@
87(line_comment) @comment
88(line_comment) @comment
88(block_comment) @comment
89(block_comment) @comment
89
90
91+; Punctuation
92+
93+[
94+ "::"
95+ "."
96+ ";"
97+ ","
98+] @punctuation.delimiter
99+
100+[
101+ "@"
102+ "..."
103+] @punctuation.special
104+
105+[
106+ "("
107+ ")"
108+ "["
109+ "]"
110+ "{"
111+ "}"
112+] @punctuation.bracket
113+
114+(type_arguments
115+ [
116+ "<"
117+ ">"
118+ ] @punctuation.bracket)
119+
120+(type_parameters
121+ [
122+ "<"
123+ ">"
124+ ] @punctuation.bracket)
125+
126+; Operators
127+
128+[
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
168+
90; Keywords
169; Keywords
91
170
92[
171[
runtime/queries/typescript/highlights.scm+12−7
@@ -5,7 +5,6 @@
5
5
6(ambient_declaration "global" @namespace)
6(ambient_declaration "global" @namespace)
7
7
8−
9; Variables
8; Variables
10
9
11(required_parameter (identifier) @variable.parameter)
10(required_parameter (identifier) @variable.parameter)
@@ -22,8 +21,6 @@
22
21
23(conditional_type ["?" ":"] @operator)
22(conditional_type ["?" ":"] @operator)
24
23
25−
26−
27; Keywords
24; Keywords
28
25
29[
26[
@@ -50,16 +47,22 @@
50 "readonly"
47 "readonly"
51] @keyword.storage.modifier
48] @keyword.storage.modifier
52
49
53−; inherits: ecma
54−
55; Types
50; Types
56
51
57(type_identifier) @type
52(type_identifier) @type
58(predefined_type) @type.builtin
53(predefined_type) @type.builtin
59
54
60(type_arguments
55(type_arguments
56+ [
57+ "<"
58+ ">"
61− "<" @punctuation.bracket
59+ ] @punctuation.bracket)
60+
61+(type_parameters
62+ [
63+ "<"
64+ ">"
62− ">" @punctuation.bracket)
65+ ] @punctuation.bracket)
63
66
64((identifier) @type
67((identifier) @type
65 (#match? @type "^[A-Z]"))
68 (#match? @type "^[A-Z]"))
@@ -75,3 +78,5 @@
75(template_type
78(template_type
76 "${" @punctuation.special
79 "${" @punctuation.special
77 "}" @punctuation.special) @embedded
80 "}" @punctuation.special) @embedded
81+
82+; inherits: ecma