on master help sign in
JS/TS highlighting improvements (#3219)
bf74a46Philipp Mildenberger
runtime/queries/javascript/highlights.scm+5
@@ -66,6 +66,8 @@
66;-----------
66;-----------
67
67
68(property_identifier) @variable.other.member
68(property_identifier) @variable.other.member
69+(shorthand_property_identifier) @variable.other.member
70+(shorthand_property_identifier_pattern) @variable.other.member
69
71
70; Literals
72; Literals
71;---------
73;---------
@@ -149,8 +151,11 @@
149 "&&="
151 "&&="
150 "||="
152 "||="
151 "??="
153 "??="
154+ "..."
152] @operator
155] @operator
153
156
157+(ternary_expression ["?" ":"] @operator)
158+
154[
159[
155 "("
160 "("
156 ")"
161 ")"
runtime/queries/typescript/highlights.scm+33−11
@@ -1,28 +1,36 @@
1−; inherits: javascript
1+; Namespaces
2−
3−; Types
4
2
5−(type_identifier) @type
3+(internal_module
6−(predefined_type) @type.builtin
4+ [((identifier) @namespace) ((nested_identifier (identifier) @namespace))])
7
5
8−((identifier) @type
6+(ambient_declaration "global" @namespace)
9− (#match? @type "^[A-Z]"))
10
7
11−(type_arguments
12− "<" @punctuation.bracket
13− ">" @punctuation.bracket)
14
8
15; Variables
9; Variables
16
10
17(required_parameter (identifier) @variable.parameter)
11(required_parameter (identifier) @variable.parameter)
18(optional_parameter (identifier) @variable.parameter)
12(optional_parameter (identifier) @variable.parameter)
19
13
14+; Punctuation
15+
16+[
17+ ":"
18+] @punctuation.delimiter
19+
20+(optional_parameter "?" @punctuation.special)
21+(property_signature "?" @punctuation.special)
22+
23+(conditional_type ["?" ":"] @operator)
24+
25+
26+
20; Keywords
27; Keywords
21
28
22[
29[
23 "abstract"
30 "abstract"
24 "declare"
31 "declare"
25 "export"
32 "export"
33+ "infer"
26 "implements"
34 "implements"
27 "keyof"
35 "keyof"
28 "namespace"
36 "namespace"
@@ -39,4 +47,18 @@
39 "private"
47 "private"
40 "protected"
48 "protected"
41 "readonly"
49 "readonly"
42−] @keyword.storage.modifier
50+] @keyword.storage.modifier
51+
52+; inherits: javascript
53+
54+; Types
55+
56+(type_identifier) @type
57+(predefined_type) @type.builtin
58+
59+(type_arguments
60+ "<" @punctuation.bracket
61+ ">" @punctuation.bracket)
62+
63+((identifier) @type
64+ (#match? @type "^[A-Z]"))