on a24fb17 help sign in
213 lines 2.9 kB history raw
1; JSX
2;----
4(jsx_opening_element (identifier) @tag)
5(jsx_closing_element (identifier) @tag)
6(jsx_self_closing_element (identifier) @tag)
7(jsx_attribute (property_identifier) @variable.other.member)
9; Special identifiers
10;--------------------
12([
13 (identifier)
14 (shorthand_property_identifier)
15 (shorthand_property_identifier_pattern)
16 ] @constant
17 (#match? @constant "^[A-Z_][A-Z\\d_]+$"))
20((identifier) @constructor
21 (#match? @constructor "^[A-Z]"))
23((identifier) @variable.builtin
24 (#match? @variable.builtin "^(arguments|module|console|window|document)$")
25 (#is-not? local))
27((identifier) @function.builtin
28 (#eq? @function.builtin "require")
29 (#is-not? local))
31; Function and method definitions
32;--------------------------------
34(function
35 name: (identifier) @function)
36(function_declaration
37 name: (identifier) @function)
38(method_definition
39 name: (property_identifier) @function.method)
41(pair
42 key: (property_identifier) @function.method
43 value: [(function) (arrow_function)])
45(assignment_expression
46 left: (member_expression
47 property: (property_identifier) @function.method)
48 right: [(function) (arrow_function)])
50(variable_declarator
51 name: (identifier) @function
52 value: [(function) (arrow_function)])
54(assignment_expression
55 left: (identifier) @function
56 right: [(function) (arrow_function)])
58; Function and method calls
59;--------------------------
61(call_expression
62 function: (identifier) @function)
64(call_expression
65 function: (member_expression
66 property: (property_identifier) @function.method))
68; Variables
69;----------
71(identifier) @variable
73; Properties
74;-----------
76(property_identifier) @variable.other.member
78; Literals
79;---------
81(this) @variable.builtin
82(super) @variable.builtin
85 (true)
86 (false)
87 (null)
88 (undefined)
89] @constant.builtin
91(comment) @comment
94 (string)
95 (template_string)
96] @string
98(regex) @string.regexp
99(number) @constant.numeric.integer
101; Tokens
102;-------
104(template_substitution
105 "${" @punctuation.special
106 "}" @punctuation.special) @embedded
109 ";"
110 "?."
111 "."
112 ","
113] @punctuation.delimiter
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 "||"
156 "??"
157 "&&="
158 "||="
159 "??="
160] @operator
163 "("
164 ")"
165 "["
166 "]"
167 "{"
168 "}"
169] @punctuation.bracket
172 "as"
173 "async"
174 "await"
175 "break"
176 "case"
177 "catch"
178 "class"
179 "const"
180 "continue"
181 "debugger"
182 "default"
183 "delete"
184 "do"
185 "else"
186 "export"
187 "extends"
188 "finally"
189 "for"
190 "from"
191 "function"
192 "get"
193 "if"
194 "import"
195 "in"
196 "instanceof"
197 "let"
198 "new"
199 "of"
200 "return"
201 "set"
202 "static"
203 "switch"
204 "target"
205 "throw"
206 "try"
207 "typeof"
208 "var"
209 "void"
210 "while"
211 "with"
212 "yield"
213] @keyword