on master help sign in
Highlight query improvements for java and typescript (#7145)

* Add missing queries to java highlights * Fix generic type bracket highlights in typescript

commit86ef389c0dfc445ba2888a81edcc13113d1638bc authorGammut <andres@makaco.design> dateFri 26 May 2023, 16:37 (3 years ago) parent61a8995
2 files changed+93−9
runtime/queries/java/highlights.scm+81−2 runtime/queries/typescript/highlights.scm+12−7
runtime/queries/java/highlights.scm+81−2
@@ -13,8 +13,6 @@
1313(marker_annotation
1414 name: (identifier) @attribute)
1515
16−"@" @operator
17−
1816; Types
1917
2018(interface_declaration
@@ -48,6 +46,9 @@
4846 (void_type)
4947] @type.builtin
5048
49+(type_arguments
50+ (wildcard "?" @type.builtin))
51+
5152; Variables
5253
5354((identifier) @constant
@@ -87,6 +88,84 @@
8788(line_comment) @comment
8889(block_comment) @comment
8990
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+
90169; Keywords
91170
92171[
runtime/queries/typescript/highlights.scm+12−7
@@ -5,7 +5,6 @@
55
66(ambient_declaration "global" @namespace)
77
8−
98; Variables
109
1110(required_parameter (identifier) @variable.parameter)
@@ -22,8 +21,6 @@
2221
2322(conditional_type ["?" ":"] @operator)
2423
25−
26−
2724; Keywords
2825
2926[
@@ -50,16 +47,22 @@
5047 "readonly"
5148] @keyword.storage.modifier
5249
53−; inherits: ecma
54−
5550; Types
5651
5752(type_identifier) @type
5853(predefined_type) @type.builtin
5954
6055(type_arguments
61− "<" @punctuation.bracket
62− ">" @punctuation.bracket)
56+ [
57+ "<"
58+ ">"
59+ ] @punctuation.bracket)
60+
61+(type_parameters
62+ [
63+ "<"
64+ ">"
65+ ] @punctuation.bracket)
6366
6467((identifier) @type
6568 (#match? @type "^[A-Z]"))
@@ -75,3 +78,5 @@
7578(template_type
7679 "${" @punctuation.special
7780 "}" @punctuation.special) @embedded
81+
82+; inherits: ecma