on 9f4802e help sign in
220 lines 3.0 kB history raw
1; Special identifiers
2;--------------------
4([
5 (identifier)
6 (shorthand_property_identifier)
7 (shorthand_property_identifier_pattern)
8 ] @constant
9 (#match? @constant "^[A-Z_][A-Z\\d_]+$"))
12((identifier) @constructor
13 (#match? @constructor "^[A-Z]"))
15((identifier) @variable.builtin
16 (#match? @variable.builtin "^(arguments|module|console|window|document)$")
17 (#is-not? local))
19((identifier) @function.builtin
20 (#eq? @function.builtin "require")
21 (#is-not? local))
23; Function and method definitions
24;--------------------------------
26(function
27 name: (identifier) @function)
28(function_declaration
29 name: (identifier) @function)
30(method_definition
31 name: (property_identifier) @function.method)
33(pair
34 key: (property_identifier) @function.method
35 value: [(function) (arrow_function)])
37(assignment_expression
38 left: (member_expression
39 property: (property_identifier) @function.method)
40 right: [(function) (arrow_function)])
42(variable_declarator
43 name: (identifier) @function
44 value: [(function) (arrow_function)])
46(assignment_expression
47 left: (identifier) @function
48 right: [(function) (arrow_function)])
50; Function and method calls
51;--------------------------
53(call_expression
54 function: (identifier) @function)
56(call_expression
57 function: (member_expression
58 property: (property_identifier) @function.method))
60; Variables
61;----------
63(identifier) @variable
65; Properties
66;-----------
68(property_identifier) @variable.other.member
69(shorthand_property_identifier) @variable.other.member
70(shorthand_property_identifier_pattern) @variable.other.member
72; Literals
73;---------
75(this) @variable.builtin
76(super) @variable.builtin
79 (true)
80 (false)
81 (null)
82 (undefined)
83] @constant.builtin
85(comment) @comment
88 (string)
89 (template_string)
90] @string
92(regex) @string.regexp
93(number) @constant.numeric.integer
95; Tokens
96;-------
98(template_substitution
99 "${" @punctuation.special
100 "}" @punctuation.special) @embedded
103 ";"
104 "?."
105 "."
106 ","
107] @punctuation.delimiter
110 "-"
111 "--"
112 "-="
113 "+"
114 "++"
115 "+="
116 "*"
117 "*="
118 "**"
119 "**="
120 "/"
121 "/="
122 "%"
123 "%="
124 "<"
125 "<="
126 "<<"
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] @operator
157(ternary_expression ["?" ":"] @operator)
160 "("
161 ")"
162 "["
163 "]"
164 "{"
165 "}"
166] @punctuation.bracket
169 "as"
170 "async"
171 "debugger"
172 "delete"
173 "extends"
174 "from"
175 "function"
176 "get"
177 "in"
178 "instanceof"
179 "new"
180 "of"
181 "set"
182 "static"
183 "target"
184 "try"
185 "typeof"
186 "void"
187 "with"
188] @keyword
191 "class"
192 "let"
193 "const"
194 "var"
195] @keyword.storage.type
198 "switch"
199 "case"
200 "default"
201 "if"
202 "else"
203 "yield"
204 "throw"
205 "finally"
206 "return"
207 "catch"
208 "continue"
209 "while"
210 "break"
211 "for"
212 "do"
213 "await"
214] @keyword.control
217 "import"
218 "export"
219] @keyword.control.import