on 6684c0b help sign in
bat/assets/syntaxes/TypeScript.sublime-syntax
3315 lines 185 kB history raw
1%YAML 1.2
2---
3# http://www.sublimetext.com/docs/3/syntax.html
4name: TypeScript
5file_extensions:
6 - ts
7scope: source.ts
8contexts:
9 main:
10 - include: directives
11 - include: statements
12 - match: \A(#!).*(?=$)
13 scope: comment.line.shebang.ts
14 captures:
15 1: punctuation.definition.comment.ts
16 comment:
17 - match: /\*\*(?!/)
18 captures:
19 0: punctuation.definition.comment.ts
20 push:
21 - meta_scope: comment.block.documentation.ts
22 - match: \*/
23 captures:
24 0: punctuation.definition.comment.ts
25 pop: true
26 - include: docblock
27 - match: (/\*)(?:\s*((@)internal)(?=\s|(\*/)))?
28 captures:
29 1: punctuation.definition.comment.ts
30 2: storage.type.internaldeclaration.ts
31 3: punctuation.decorator.internaldeclaration.ts
32 push:
33 - meta_scope: comment.block.ts
34 - match: \*/
35 captures:
36 0: punctuation.definition.comment.ts
37 pop: true
38 - match: '(^[ \t]+)?((//)(?:\s*((@)internal)(?=\s|$))?)'
39 captures:
40 1: punctuation.whitespace.comment.leading.ts
41 2: comment.line.double-slash.ts
42 3: punctuation.definition.comment.ts
43 4: storage.type.internaldeclaration.ts
44 5: punctuation.decorator.internaldeclaration.ts
45 push:
46 - meta_content_scope: comment.line.double-slash.ts
47 - match: (?=$)
48 pop: true
49 access-modifier:
50 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(abstract|public|protected|private|readonly|static)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
51 scope: storage.modifier.ts
52 after-operator-block-as-object-literal:
53 - match: '(?<!\+\+|--)(?<=[:=(,\[?+!>]|^await|[^\._$[:alnum:]]await|^return|[^\._$[:alnum:]]return|^yield|[^\._$[:alnum:]]yield|^throw|[^\._$[:alnum:]]throw|^in|[^\._$[:alnum:]]in|^of|[^\._$[:alnum:]]of|^typeof|[^\._$[:alnum:]]typeof|&&|\|\||\*)\s*(\{)'
54 captures:
55 1: punctuation.definition.block.ts
56 push:
57 - meta_scope: meta.objectliteral.ts
58 - match: '\}'
59 captures:
60 0: punctuation.definition.block.ts
61 pop: true
62 - include: object-member
63 array-binding-pattern:
64 - match: '(?:(\.\.\.)\s*)?(\[)'
65 captures:
66 1: keyword.operator.rest.ts
67 2: punctuation.definition.binding-pattern.array.ts
68 push:
69 - match: '\]'
70 captures:
71 0: punctuation.definition.binding-pattern.array.ts
72 pop: true
73 - include: binding-element
74 - include: punctuation-comma
75 array-binding-pattern-const:
76 - match: '(?:(\.\.\.)\s*)?(\[)'
77 captures:
78 1: keyword.operator.rest.ts
79 2: punctuation.definition.binding-pattern.array.ts
80 push:
81 - match: '\]'
82 captures:
83 0: punctuation.definition.binding-pattern.array.ts
84 pop: true
85 - include: binding-element-const
86 - include: punctuation-comma
87 array-literal:
88 - match: '\s*(\[)'
89 captures:
90 1: meta.brace.square.ts
91 push:
92 - meta_scope: meta.array.literal.ts
93 - match: '\]'
94 captures:
95 0: meta.brace.square.ts
96 pop: true
97 - include: expression
98 - include: punctuation-comma
99 arrow-function:
100 - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(\basync)\s+)?([_$[:alpha:]][_$[:alnum:]]*)\s*(?==>)'
101 scope: meta.arrow.ts
102 captures:
103 1: storage.modifier.async.ts
104 2: variable.parameter.ts
105 - match: |-
106 (?x) (?:
107 (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(\basync)
108 )? ((?<![})!\]])\s*
109 (?=
110 # sure shot arrow functions even if => is on new line
111 (
112 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
113 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
114 (
115 ([)]\s*:) | # ():
116 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
117 )
118 ) |
120 # arrow function possible to detect only with => on same line
121 (
122 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
123 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
124 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
125 \s*=> # arrow operator
126 )
127 )
128 )
129 captures:
130 1: storage.modifier.async.ts
131 push:
132 - meta_scope: meta.arrow.ts
133 - match: '(?==>|\{|(^\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\s+))'
134 pop: true
135 - include: comment
136 - include: type-parameters
137 - include: function-parameters
138 - include: arrow-return-type
139 - include: possibly-arrow-return-type
140 - match: "=>"
141 captures:
142 0: storage.type.function.arrow.ts
143 push:
144 - meta_scope: meta.arrow.ts
145 - match: '((?<=\}|\S)(?<!=>)|((?!\{)(?=\S)))(?!\/[\/\*])'
146 pop: true
147 - include: single-line-comment-consuming-line-ending
148 - include: decl-block
149 - include: expression
150 arrow-return-type:
151 - match: (?<=\))\s*(:)
152 captures:
153 1: keyword.operator.type.annotation.ts
154 push:
155 - meta_scope: meta.return.type.arrow.ts
156 - match: '(?==>|\{|(^\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\s+))'
157 pop: true
158 - include: arrow-return-type-body
159 arrow-return-type-body:
160 - match: '(?<=[:])(?=\s*\{)'
161 push:
162 - match: '(?<=\})'
163 pop: true
164 - include: type-object
165 - include: type-predicate-operator
166 - include: type
167 async-modifier:
168 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(async)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
169 scope: storage.modifier.async.ts
170 binding-element:
171 - include: comment
172 - include: string
173 - include: numeric-literal
174 - include: regex
175 - include: object-binding-pattern
176 - include: array-binding-pattern
177 - include: destructuring-variable-rest
178 - include: variable-initializer
179 binding-element-const:
180 - include: comment
181 - include: string
182 - include: numeric-literal
183 - include: regex
184 - include: object-binding-pattern-const
185 - include: array-binding-pattern-const
186 - include: destructuring-variable-rest-const
187 - include: variable-initializer
188 boolean-literal:
189 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))true(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
190 scope: constant.language.boolean.true.ts
191 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))false(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
192 scope: constant.language.boolean.false.ts
193 brackets:
194 - match: "{"
195 push:
196 - match: '}|(?=\*/)'
197 pop: true
198 - include: brackets
199 - match: '\['
200 push:
201 - match: '\]|(?=\*/)'
202 pop: true
203 - include: brackets
204 cast:
205 - match: \s*(<)\s*(const)\s*(>)
206 scope: cast.expr.ts
207 captures:
208 1: meta.brace.angle.ts
209 2: storage.modifier.ts
210 3: meta.brace.angle.ts
211 - match: '(?:(?<!\+\+|--)(?<=^return|[^\._$[:alnum:]]return|^throw|[^\._$[:alnum:]]throw|^yield|[^\._$[:alnum:]]yield|^await|[^\._$[:alnum:]]await|^default|[^\._$[:alnum:]]default|[=(,:>*?\&\|\^]|[^_$[:alnum:]](?:\+\+|\-\-)|[^\+]\+|[^\-]\-))\s*(<)(?!<?\=)(?!\s*$)'
212 captures:
213 1: meta.brace.angle.ts
214 push:
215 - meta_scope: cast.expr.ts
216 - match: (\>)
217 captures:
218 1: meta.brace.angle.ts
219 pop: true
220 - include: type
221 - match: '(?:(?<=^))\s*(<)(?=[_$[:alpha:]][_$[:alnum:]]*\s*>)'
222 captures:
223 1: meta.brace.angle.ts
224 push:
225 - meta_scope: cast.expr.ts
226 - match: (\>)
227 captures:
228 1: meta.brace.angle.ts
229 pop: true
230 - include: type
231 class-declaration:
232 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(?:(abstract)\s+)?\b(class)\b(?=\s+|/[/*])'
233 captures:
234 1: keyword.control.export.ts
235 2: storage.modifier.ts
236 3: storage.modifier.ts
237 4: storage.type.class.ts
238 push:
239 - meta_scope: meta.class.ts
240 - match: '(?<=\})'
241 pop: true
242 - include: class-declaration-or-expression-patterns
243 class-declaration-or-expression-patterns:
244 - include: comment
245 - include: class-or-interface-heritage
246 - match: "[_$[:alpha:]][_$[:alnum:]]*"
247 captures:
248 0: entity.name.type.class.ts
249 - include: type-parameters
250 - include: class-or-interface-body
251 class-expression:
252 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(abstract)\s+)?(class)\b(?=\s+|[<{]|\/[\/*])'
253 captures:
254 1: storage.modifier.ts
255 2: storage.type.class.ts
256 push:
257 - meta_scope: meta.class.ts
258 - match: '(?<=\})'
259 pop: true
260 - include: class-declaration-or-expression-patterns
261 class-or-interface-body:
262 - match: '\{'
263 captures:
264 0: punctuation.definition.block.ts
265 push:
266 - match: '\}'
267 captures:
268 0: punctuation.definition.block.ts
269 pop: true
270 - include: comment
271 - include: decorator
272 - match: (?<=:)\s*
273 push:
274 - match: '(?=\s|[;),}\]:\-\+]|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
275 pop: true
276 - include: expression
277 - include: method-declaration
278 - include: indexer-declaration
279 - include: field-declaration
280 - include: string
281 - include: type-annotation
282 - include: variable-initializer
283 - include: access-modifier
284 - include: property-accessor
285 - include: async-modifier
286 - include: after-operator-block-as-object-literal
287 - include: decl-block
288 - include: expression
289 - include: punctuation-comma
290 - include: punctuation-semicolon
291 class-or-interface-heritage:
292 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(extends|implements)\b)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
293 captures:
294 1: storage.modifier.ts
295 push:
296 - match: '(?=\{)'
297 pop: true
298 - include: comment
299 - include: class-or-interface-heritage
300 - include: type-parameters
301 - include: expressionWithoutIdentifiers
302 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))(?=\s*[_$[:alpha:]][_$[:alnum:]]*(\s*\??\.\s*[_$[:alpha:]][_$[:alnum:]]*)*\s*)'
303 captures:
304 1: entity.name.type.module.ts
305 2: punctuation.accessor.ts
306 3: punctuation.accessor.optional.ts
307 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
308 captures:
309 1: entity.other.inherited-class.ts
310 - include: expressionPunctuations
311 control-statement:
312 - include: switch-statement
313 - include: for-loop
314 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(catch|finally|throw|try)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
315 scope: keyword.control.trycatch.ts
316 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(break|continue|goto)\s+([_$[:alpha:]][_$[:alnum:]]*)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
317 captures:
318 1: keyword.control.loop.ts
319 2: entity.name.label.ts
320 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(break|continue|do|goto|while)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
321 scope: keyword.control.loop.ts
322 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(return)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
323 scope: keyword.control.flow.ts
324 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(case|default|switch)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
325 scope: keyword.control.switch.ts
326 - include: if-statement
327 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(else|if)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
328 scope: keyword.control.conditional.ts
329 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(with)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
330 scope: keyword.control.with.ts
331 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(package)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
332 scope: keyword.control.ts
333 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(debugger)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
334 scope: keyword.other.debugger.ts
335 decl-block:
336 - match: '\{'
337 captures:
338 0: punctuation.definition.block.ts
339 push:
340 - meta_scope: meta.block.ts
341 - match: '\}'
342 captures:
343 0: punctuation.definition.block.ts
344 pop: true
345 - include: statements
346 declaration:
347 - include: decorator
348 - include: var-expr
349 - include: function-declaration
350 - include: class-declaration
351 - include: interface-declaration
352 - include: enum-declaration
353 - include: namespace-declaration
354 - include: type-alias-declaration
355 - include: import-equals-declaration
356 - include: import-declaration
357 - include: export-declaration
358 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(declare|export)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
359 scope: storage.modifier.ts
360 decorator:
361 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))\@'
362 captures:
363 0: punctuation.decorator.ts
364 push:
365 - meta_scope: meta.decorator.ts
366 - match: (?=\s)
367 pop: true
368 - include: expression
369 destructuring-const:
370 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\{)'
371 push:
372 - meta_scope: meta.object-binding-pattern-variable.ts
373 - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
374 pop: true
375 - include: object-binding-pattern-const
376 - include: type-annotation
377 - include: comment
378 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\[)'
379 push:
380 - meta_scope: meta.array-binding-pattern-variable.ts
381 - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
382 pop: true
383 - include: array-binding-pattern-const
384 - include: type-annotation
385 - include: comment
386 destructuring-parameter:
387 - match: '(?<!=|:)\s*(?:(\.\.\.)\s*)?(\{)'
388 captures:
389 1: keyword.operator.rest.ts
390 2: punctuation.definition.binding-pattern.object.ts
391 push:
392 - meta_scope: meta.parameter.object-binding-pattern.ts
393 - match: '\}'
394 captures:
395 0: punctuation.definition.binding-pattern.object.ts
396 pop: true
397 - include: parameter-object-binding-element
398 - match: '(?<!=|:)\s*(?:(\.\.\.)\s*)?(\[)'
399 captures:
400 1: keyword.operator.rest.ts
401 2: punctuation.definition.binding-pattern.array.ts
402 push:
403 - meta_scope: meta.paramter.array-binding-pattern.ts
404 - match: '\]'
405 captures:
406 0: punctuation.definition.binding-pattern.array.ts
407 pop: true
408 - include: parameter-binding-element
409 - include: punctuation-comma
410 destructuring-parameter-rest:
411 - match: '(?:(\.\.\.)\s*)?([_$[:alpha:]][_$[:alnum:]]*)'
412 captures:
413 1: keyword.operator.rest.ts
414 2: variable.parameter.ts
415 destructuring-variable:
416 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\{)'
417 push:
418 - meta_scope: meta.object-binding-pattern-variable.ts
419 - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
420 pop: true
421 - include: object-binding-pattern
422 - include: type-annotation
423 - include: comment
424 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\[)'
425 push:
426 - meta_scope: meta.array-binding-pattern-variable.ts
427 - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
428 pop: true
429 - include: array-binding-pattern
430 - include: type-annotation
431 - include: comment
432 destructuring-variable-rest:
433 - match: '(?:(\.\.\.)\s*)?([_$[:alpha:]][_$[:alnum:]]*)'
434 captures:
435 1: keyword.operator.rest.ts
436 2: meta.definition.variable.ts variable.other.readwrite.ts
437 destructuring-variable-rest-const:
438 - match: '(?:(\.\.\.)\s*)?([_$[:alpha:]][_$[:alnum:]]*)'
439 captures:
440 1: keyword.operator.rest.ts
441 2: meta.definition.variable.ts variable.other.constant.ts
442 directives:
443 - match: '^(///)\s*(?=<(reference|amd-dependency|amd-module)(\s+(path|types|no-default-lib|lib|name)\s*=\s*((\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)))+\s*/>\s*$)'
444 captures:
445 1: punctuation.definition.comment.ts
446 push:
447 - meta_scope: comment.line.triple-slash.directive.ts
448 - match: (?=$)
449 pop: true
450 - match: (<)(reference|amd-dependency|amd-module)
451 captures:
452 1: punctuation.definition.tag.directive.ts
453 2: entity.name.tag.directive.ts
454 push:
455 - meta_scope: meta.tag.ts
456 - match: />
457 captures:
458 0: punctuation.definition.tag.directive.ts
459 pop: true
460 - match: path|types|no-default-lib|lib|name
461 scope: entity.other.attribute-name.directive.ts
462 - match: "="
463 scope: keyword.operator.assignment.ts
464 - include: string
465 docblock:
466 - match: |-
467 (?x)
468 ((@)(?:access|api))
469 \s+
470 (private|protected|public)
471 \b
472 captures:
473 1: storage.type.class.jsdoc
474 2: punctuation.definition.block.tag.jsdoc
475 3: constant.language.access-type.jsdoc
476 - match: |-
477 (?x)
478 ((@)author)
479 \s+
480 (
481 [^@\s<>*/]
482 (?:[^@<>*/]|\*[^/])*
483 )
484 (?:
485 \s*
486 (<)
487 ([^>\s]+)
488 (>)
489 )?
490 captures:
491 1: storage.type.class.jsdoc
492 2: punctuation.definition.block.tag.jsdoc
493 3: entity.name.type.instance.jsdoc
494 4: punctuation.definition.bracket.angle.begin.jsdoc
495 5: constant.other.email.link.underline.jsdoc
496 6: punctuation.definition.bracket.angle.end.jsdoc
497 - match: |-
498 (?x)
499 ((@)borrows) \s+
500 ((?:[^@\s*/]|\*[^/])+) # <that namepath>
501 \s+ (as) \s+ # as
502 ((?:[^@\s*/]|\*[^/])+) # <this namepath>
503 captures:
504 1: storage.type.class.jsdoc
505 2: punctuation.definition.block.tag.jsdoc
506 3: entity.name.type.instance.jsdoc
507 4: keyword.operator.control.jsdoc
508 5: entity.name.type.instance.jsdoc
509 - match: ((@)example)\s+
510 captures:
511 1: storage.type.class.jsdoc
512 2: punctuation.definition.block.tag.jsdoc
513 push:
514 - meta_scope: meta.example.jsdoc
515 - match: (?=@|\*/)
516 pop: true
517 - match: ^\s\*\s+
518 - match: \G(<)caption(>)
519 captures:
520 0: entity.name.tag.inline.jsdoc
521 1: punctuation.definition.bracket.angle.begin.jsdoc
522 2: punctuation.definition.bracket.angle.end.jsdoc
523 push:
524 - meta_content_scope: constant.other.description.jsdoc
525 - match: (</)caption(>)|(?=\*/)
526 captures:
527 0: entity.name.tag.inline.jsdoc
528 1: punctuation.definition.bracket.angle.begin.jsdoc
529 2: punctuation.definition.bracket.angle.end.jsdoc
530 pop: true
531 - match: '[^\s@*](?:[^*]|\*[^/])*'
532 captures:
533 0: source.embedded.ts
534 - match: (?x) ((@)kind) \s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \b
535 captures:
536 1: storage.type.class.jsdoc
537 2: punctuation.definition.block.tag.jsdoc
538 3: constant.language.symbol-type.jsdoc
539 - match: |-
540 (?x)
541 ((@)see)
542 \s+
543 (?:
544 # URL
545 (
546 (?=https?://)
547 (?:[^\s*]|\*[^/])+
548 )
549 |
550 # JSDoc namepath
551 (
552 (?!
553 # Avoid matching bare URIs (also acceptable as links)
554 https?://
555 |
556 # Avoid matching {@inline tags}; we match those below
557 (?:\[[^\[\]]*\])? # Possible description [preceding]{@tag}
558 {@(?:link|linkcode|linkplain|tutorial)\b
559 )
560 # Matched namepath
561 (?:[^@\s*/]|\*[^/])+
562 )
563 )
564 captures:
565 1: storage.type.class.jsdoc
566 2: punctuation.definition.block.tag.jsdoc
567 3: variable.other.link.underline.jsdoc
568 4: entity.name.type.instance.jsdoc
569 - match: |-
570 (?x)
571 ((@)template)
572 \s+
573 # One or more valid identifiers
574 (
575 [A-Za-z_$] # First character: non-numeric word character
576 [\w$.\[\]]* # Rest of identifier
577 (?: # Possible list of additional identifiers
578 \s* , \s*
579 [A-Za-z_$]
580 [\w$.\[\]]*
581 )*
582 )
583 captures:
584 1: storage.type.class.jsdoc
585 2: punctuation.definition.block.tag.jsdoc
586 3: variable.other.jsdoc
587 - match: |-
588 (?x)
589 (
590 (@)
591 (?:arg|argument|const|constant|member|namespace|param|var)
592 )
593 \s+
594 (
595 [A-Za-z_$]
596 [\w$.\[\]]*
597 )
598 captures:
599 1: storage.type.class.jsdoc
600 2: punctuation.definition.block.tag.jsdoc
601 3: variable.other.jsdoc
602 - match: '((@)typedef)\s+(?={)'
603 captures:
604 1: storage.type.class.jsdoc
605 2: punctuation.definition.block.tag.jsdoc
606 push:
607 - match: '(?=\s|\*/|[^{}\[\]A-Za-z_$])'
608 pop: true
609 - include: jsdoctype
610 - match: '(?:[^@\s*/]|\*[^/])+'
611 scope: entity.name.type.instance.jsdoc
612 - match: '((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\s+(?={)'
613 captures:
614 1: storage.type.class.jsdoc
615 2: punctuation.definition.block.tag.jsdoc
616 push:
617 - match: '(?=\s|\*/|[^{}\[\]A-Za-z_$])'
618 pop: true
619 - include: jsdoctype
620 - match: '([A-Za-z_$][\w$.\[\]]*)'
621 scope: variable.other.jsdoc
622 - match: |-
623 (?x)
624 (\[)\s*
625 [\w$]+
626 (?:
627 (?:\[\])? # Foo[ ].bar properties within an array
628 \. # Foo.Bar namespaced parameter
629 [\w$]+
630 )*
631 (?:
632 \s*
633 (=) # [foo=bar] Default parameter value
634 \s*
635 (
636 # The inner regexes are to stop the match early at */ and to not stop at escaped quotes
637 (?>
638 "(?:(?:\*(?!/))|(?:\\(?!"))|[^*\\])*?" | # [foo="bar"] Double-quoted
639 '(?:(?:\*(?!/))|(?:\\(?!'))|[^*\\])*?' | # [foo='bar'] Single-quoted
640 \[ (?:(?:\*(?!/))|[^*])*? \] | # [foo=[1,2]] Array literal
641 (?:(?:\*(?!/))|\s(?!\s*\])|\[.*?(?:\]|(?=\*/))|[^*\s\[\]])* # Everything else
642 )*
643 )
644 )?
645 \s*(?:(\])((?:[^*\s]|\*[^\s/])+)?|(?=\*/))
646 scope: variable.other.jsdoc
647 captures:
648 1: punctuation.definition.optional-value.begin.bracket.square.jsdoc
649 2: keyword.operator.assignment.jsdoc
650 3: source.embedded.ts
651 4: punctuation.definition.optional-value.end.bracket.square.jsdoc
652 5: invalid.illegal.syntax.jsdoc
653 - match: |-
654 (?x)
655 (
656 (@)
657 (?:define|enum|exception|export|extends|lends|implements|modifies
658 |namespace|private|protected|returns?|suppress|this|throws|type
659 |yields?)
660 )
661 \s+(?={)
662 captures:
663 1: storage.type.class.jsdoc
664 2: punctuation.definition.block.tag.jsdoc
665 push:
666 - match: '(?=\s|\*/|[^{}\[\]A-Za-z_$])'
667 pop: true
668 - include: jsdoctype
669 - match: |-
670 (?x)
671 (
672 (@)
673 (?:alias|augments|callback|constructs|emits|event|fires|exports?
674 |extends|external|function|func|host|lends|listens|interface|memberof!?
675 |method|module|mixes|mixin|name|requires|see|this|typedef|uses)
676 )
677 \s+
678 (
679 (?:
680 [^{}@\s*] | \*[^/]
681 )+
682 )
683 captures:
684 1: storage.type.class.jsdoc
685 2: punctuation.definition.block.tag.jsdoc
686 3: entity.name.type.instance.jsdoc
687 - match: '((@)(?:default(?:value)?|license|version))\s+(([''''"]))'
688 captures:
689 1: storage.type.class.jsdoc
690 2: punctuation.definition.block.tag.jsdoc
691 3: variable.other.jsdoc
692 4: punctuation.definition.string.begin.jsdoc
693 push:
694 - meta_content_scope: variable.other.jsdoc
695 - match: (\3)|(?=$|\*/)
696 captures:
697 0: variable.other.jsdoc
698 1: punctuation.definition.string.end.jsdoc
699 pop: true
700 - match: '((@)(?:default(?:value)?|license|tutorial|variation|version))\s+([^\s*]+)'
701 captures:
702 1: storage.type.class.jsdoc
703 2: punctuation.definition.block.tag.jsdoc
704 3: variable.other.jsdoc
705 - match: '(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \b'
706 scope: storage.type.class.jsdoc
707 captures:
708 1: punctuation.definition.block.tag.jsdoc
709 - include: inline-tags
710 - match: '((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\s+)'
711 captures:
712 1: storage.type.class.jsdoc
713 2: punctuation.definition.block.tag.jsdoc
714 enum-declaration:
715 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?(?:\b(const)\s+)?\b(enum)\s+([_$[:alpha:]][_$[:alnum:]]*)'
716 captures:
717 1: keyword.control.export.ts
718 2: storage.modifier.ts
719 3: storage.modifier.ts
720 4: storage.type.enum.ts
721 5: entity.name.type.enum.ts
722 push:
723 - meta_scope: meta.enum.declaration.ts
724 - match: '(?<=\})'
725 pop: true
726 - include: comment
727 - match: '\{'
728 captures:
729 0: punctuation.definition.block.ts
730 push:
731 - match: '\}'
732 captures:
733 0: punctuation.definition.block.ts
734 pop: true
735 - include: comment
736 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
737 captures:
738 0: variable.other.enummember.ts
739 push:
740 - match: '(?=,|\}|$)'
741 pop: true
742 - include: comment
743 - include: variable-initializer
744 - match: '(?=((\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\])))'
745 push:
746 - match: '(?=,|\}|$)'
747 pop: true
748 - include: string
749 - include: array-literal
750 - include: comment
751 - include: variable-initializer
752 - include: punctuation-comma
753 export-declaration:
754 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(export)\s+(as)\s+(namespace)\s+([_$[:alpha:]][_$[:alnum:]]*)'
755 captures:
756 1: keyword.control.export.ts
757 2: keyword.control.as.ts
758 3: storage.type.namespace.ts
759 4: entity.name.type.module.ts
760 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(export)(?:(?:\s*(=))|(?:\s+(default)(?=\s+)))'
761 captures:
762 1: keyword.control.export.ts
763 2: keyword.operator.assignment.ts
764 3: keyword.control.default.ts
765 push:
766 - meta_scope: meta.export.default.ts
767 - match: (?=$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))
768 pop: true
769 - include: interface-declaration
770 - include: expression
771 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(export)\b(?!(\$)|(\s*:))((?=\s*[\{*])|((?=\s*[_$[:alpha:]][_$[:alnum:]]*(\s|,))(?!\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b)))'
772 captures:
773 0: keyword.control.export.ts
774 push:
775 - meta_scope: meta.export.ts
776 - match: (?=$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))
777 pop: true
778 - include: import-export-declaration
779 expression:
780 - include: expressionWithoutIdentifiers
781 - include: identifiers
782 - include: expressionPunctuations
783 expression-inside-possibly-arrow-parens:
784 - include: expressionWithoutIdentifiers
785 - include: comment
786 - include: string
787 - include: decorator
788 - include: destructuring-parameter
789 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|protected|private|readonly)\s+(?=(public|protected|private|readonly)\s+)'
790 captures:
791 1: storage.modifier.ts
792 - match: |-
793 (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*
794 # function assignment |
795 (=\s*(
796 ((async\s+)?(
797 (function\s*[(<*]) |
798 (function\s+) |
799 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
800 )) |
801 ((async\s*)?(
802 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
803 # sure shot arrow functions even if => is on new line
804 (
805 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
806 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
807 (
808 ([)]\s*:) | # ():
809 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
810 )
811 ) |
813 # arrow function possible to detect only with => on same line
814 (
815 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
816 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
817 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
818 \s*=> # arrow operator
819 )
820 ))
821 )) |
822 # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
823 (:\s*(
824 (<) |
825 ([(]\s*(
826 ([)]) |
827 (\.\.\.) |
828 ([_$[:alnum:]]+\s*(
829 ([:,?=])|
830 ([)]\s*=>)
831 ))
832 ))
833 )) |
834 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
835 (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
836 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
837 ((async\s+)?(
838 (function\s*[(<*]) |
839 (function\s+) |
840 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
841 )) |
842 ((async\s*)?(
843 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
844 # sure shot arrow functions even if => is on new line
845 (
846 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
847 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
848 (
849 ([)]\s*:) | # ():
850 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
851 )
852 ) |
854 # arrow function possible to detect only with => on same line
855 (
856 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
857 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
858 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
859 \s*=> # arrow operator
860 )
861 ))
862 )))
863 captures:
864 1: storage.modifier.ts
865 2: keyword.operator.rest.ts
866 3: entity.name.function.ts variable.language.this.ts
867 4: entity.name.function.ts
868 5: keyword.operator.optional.ts
869 - match: '(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*:)'
870 captures:
871 1: storage.modifier.ts
872 2: keyword.operator.rest.ts
873 3: variable.parameter.ts variable.language.this.ts
874 4: variable.parameter.ts
875 5: keyword.operator.optional.ts
876 - include: type-annotation
877 - include: variable-initializer
878 - match: ","
879 scope: punctuation.separator.parameter.ts
880 - include: identifiers
881 - include: expressionPunctuations
882 expression-operators:
883 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(await)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
884 scope: keyword.control.flow.ts
885 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(yield)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))(?=\s*\/\*([^\*]|(\*[^\/]))*\*\/\s*\*)'
886 captures:
887 1: keyword.control.flow.ts
888 push:
889 - match: \*
890 captures:
891 0: keyword.generator.asterisk.ts
892 pop: true
893 - include: comment
894 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(yield)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))(?:\s*(\*))?'
895 captures:
896 1: keyword.control.flow.ts
897 2: keyword.generator.asterisk.ts
898 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))delete(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
899 scope: keyword.operator.expression.delete.ts
900 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))in(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))(?!\()'
901 scope: keyword.operator.expression.in.ts
902 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))of(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))(?!\()'
903 scope: keyword.operator.expression.of.ts
904 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))instanceof(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
905 scope: keyword.operator.expression.instanceof.ts
906 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))new(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
907 scope: keyword.operator.new.ts
908 - include: typeof-operator
909 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))void(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
910 scope: keyword.operator.expression.void.ts
911 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+(const)(?=\s*($|[;,:})\]]))'
912 captures:
913 1: keyword.control.as.ts
914 2: storage.modifier.ts
915 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+'
916 captures:
917 1: keyword.control.as.ts
918 push:
919 - match: '(?=$|^|[;,:})\]]|\|\||\&\&|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+)|(\s+\<))'
920 pop: true
921 - include: type
922 - match: \.\.\.
923 scope: keyword.operator.spread.ts
924 - match: \*=|(?<!\()/=|%=|\+=|\-=
925 scope: keyword.operator.assignment.compound.ts
926 - match: \&=|\^=|<<=|>>=|>>>=|\|=
927 scope: keyword.operator.assignment.compound.bitwise.ts
928 - match: "<<|>>>|>>"
929 scope: keyword.operator.bitwise.shift.ts
930 - match: "===|!==|==|!="
931 scope: keyword.operator.comparison.ts
932 - match: <=|>=|<>|<|>
933 scope: keyword.operator.relational.ts
934 - match: \!|&&|\|\||\?\?
935 scope: keyword.operator.logical.ts
936 - match: \&|~|\^|\|
937 scope: keyword.operator.bitwise.ts
938 - match: \=
939 scope: keyword.operator.assignment.ts
940 - match: "--"
941 scope: keyword.operator.decrement.ts
942 - match: \+\+
943 scope: keyword.operator.increment.ts
944 - match: '%|\*|/|-|\+'
945 scope: keyword.operator.arithmetic.ts
946 - match: '(?<=[_$[:alnum:])\]])\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)+(/)(?![/*]))'
947 push:
948 - match: '(/)(?!\*([^\*]|(\*[^\/]))*\*\/)'
949 captures:
950 1: keyword.operator.arithmetic.ts
951 pop: true
952 - include: comment
953 - match: '(?<=[_$[:alnum:])\]])\s*(/)(?![/*])'
954 captures:
955 1: keyword.operator.arithmetic.ts
956 expressionPunctuations:
957 - include: punctuation-comma
958 - include: punctuation-accessor
959 expressionWithoutIdentifiers:
960 - include: string
961 - include: regex
962 - include: comment
963 - include: function-expression
964 - include: class-expression
965 - include: arrow-function
966 - include: paren-expression-possibly-arrow
967 - include: cast
968 - include: ternary-expression
969 - include: new-expr
970 - include: instanceof-expr
971 - include: object-literal
972 - include: expression-operators
973 - include: function-call
974 - include: literal
975 - include: support-objects
976 - include: paren-expression
977 field-declaration:
978 - match: |-
979 (?x)(?<!\()(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(readonly)\s+)?(?=\s*((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
980 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
981 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
982 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
983 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
984 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
985 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
986 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
987 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
988 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(?:(?:(\?)|(\!))\s*)?(=|:|;|,|\}|$))
989 captures:
990 1: storage.modifier.ts
991 push:
992 - meta_scope: meta.field.declaration.ts
993 - match: |-
994 (?x)(?=\}|;|,|$|(^(?!\s*((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
995 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
996 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
997 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
998 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
999 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1000 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1001 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1002 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1003 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(?:(?:(\?)|(\!))\s*)?(=|:|;|,|$))))|(?<=\})
1004 pop: true
1005 - include: variable-initializer
1006 - include: type-annotation
1007 - include: string
1008 - include: array-literal
1009 - include: numeric-literal
1010 - include: comment
1011 - match: |-
1012 (?x)([_$[:alpha:]][_$[:alnum:]]*)(?:(\?)|(\!))?(?=\s*\s*
1013 # function assignment |
1014 (=\s*(
1015 ((async\s+)?(
1016 (function\s*[(<*]) |
1017 (function\s+) |
1018 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1019 )) |
1020 ((async\s*)?(
1021 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1022 # sure shot arrow functions even if => is on new line
1024 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1025 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1027 ([)]\s*:) | # ():
1028 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1030 ) |
1032 # arrow function possible to detect only with => on same line
1034 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1035 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1036 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1037 \s*=> # arrow operator
1039 ))
1040 )) |
1041 # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
1042 (:\s*(
1043 (<) |
1044 ([(]\s*(
1045 ([)]) |
1046 (\.\.\.) |
1047 ([_$[:alnum:]]+\s*(
1048 ([:,?=])|
1049 ([)]\s*=>)
1050 ))
1051 ))
1052 )) |
1053 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
1054 (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
1055 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
1056 ((async\s+)?(
1057 (function\s*[(<*]) |
1058 (function\s+) |
1059 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1060 )) |
1061 ((async\s*)?(
1062 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1063 # sure shot arrow functions even if => is on new line
1065 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1066 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1068 ([)]\s*:) | # ():
1069 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1071 ) |
1073 # arrow function possible to detect only with => on same line
1075 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1076 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1077 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1078 \s*=> # arrow operator
1080 ))
1081 )))
1082 captures:
1083 1: meta.definition.property.ts entity.name.function.ts
1084 2: keyword.operator.optional.ts
1085 3: keyword.operator.definiteassignment.ts
1086 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1087 scope: meta.definition.property.ts variable.object.property.ts
1088 - match: \?
1089 scope: keyword.operator.optional.ts
1090 - match: \!
1091 scope: keyword.operator.definiteassignment.ts
1092 for-loop:
1093 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))for(?=((\s+|(\s*\/\*([^\*]|(\*[^\/]))*\*\/\s*))await)?\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)?(\())'
1094 captures:
1095 0: keyword.control.loop.ts
1096 push:
1097 - match: (?<=\))
1098 pop: true
1099 - include: comment
1100 - match: await
1101 scope: keyword.control.loop.ts
1102 - match: \(
1103 captures:
1104 0: meta.brace.round.ts
1105 push:
1106 - match: \)
1107 captures:
1108 0: meta.brace.round.ts
1109 pop: true
1110 - include: var-expr
1111 - include: expression
1112 - include: punctuation-semicolon
1113 function-body:
1114 - include: comment
1115 - include: type-parameters
1116 - include: function-parameters
1117 - include: return-type
1118 - include: decl-block
1119 - match: \*
1120 scope: keyword.generator.asterisk.ts
1121 function-call:
1122 - match: '(?=(((([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))\s*(?:(\?\.\s*)|(\!))?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\()'
1123 push:
1124 - match: '(?<=\))(?!(((([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))\s*(?:(\?\.\s*)|(\!))?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\()'
1125 pop: true
1126 - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))'
1127 push:
1128 - meta_scope: meta.function-call.ts
1129 - match: '(?=\s*(?:(\?\.\s*)|(\!))?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\()'
1130 pop: true
1131 - include: support-function-call-identifiers
1132 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
1133 scope: entity.name.function.ts
1134 - include: comment
1135 - match: \?\.
1136 scope: meta.function-call.ts punctuation.accessor.optional.ts
1137 - match: \!
1138 scope: meta.function-call.ts keyword.operator.definiteassignment.ts
1139 - include: type-arguments
1140 - include: paren-expression
1141 function-declaration:
1142 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*'
1143 captures:
1144 1: keyword.control.export.ts
1145 2: storage.modifier.ts
1146 3: storage.modifier.async.ts
1147 4: storage.type.function.ts
1148 5: keyword.generator.asterisk.ts
1149 6: meta.definition.function.ts entity.name.function.ts
1150 push:
1151 - meta_scope: meta.function.ts
1152 - match: '(?=;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|(?<=\})'
1153 pop: true
1154 - include: function-name
1155 - include: function-body
1156 function-expression:
1157 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*'
1158 captures:
1159 1: storage.modifier.async.ts
1160 2: storage.type.function.ts
1161 3: keyword.generator.asterisk.ts
1162 4: meta.definition.function.ts entity.name.function.ts
1163 push:
1164 - meta_scope: meta.function.expression.ts
1165 - match: '(?=;)|(?<=\})'
1166 pop: true
1167 - include: function-name
1168 - include: single-line-comment-consuming-line-ending
1169 - include: function-body
1170 function-name:
1171 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1172 scope: meta.definition.function.ts entity.name.function.ts
1173 function-parameters:
1174 - match: \(
1175 captures:
1176 0: punctuation.definition.parameters.begin.ts
1177 push:
1178 - meta_scope: meta.parameters.ts
1179 - match: \)
1180 captures:
1181 0: punctuation.definition.parameters.end.ts
1182 pop: true
1183 - include: function-parameters-body
1184 function-parameters-body:
1185 - include: comment
1186 - include: string
1187 - include: decorator
1188 - include: destructuring-parameter
1189 - include: parameter-name
1190 - include: parameter-type-annotation
1191 - include: variable-initializer
1192 - match: ","
1193 scope: punctuation.separator.parameter.ts
1194 identifiers:
1195 - include: object-identifiers
1196 - match: |-
1197 (?x)(?:(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\s*=\s*(
1198 ((async\s+)?(
1199 (function\s*[(<*]) |
1200 (function\s+) |
1201 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1202 )) |
1203 ((async\s*)?(
1204 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1205 # sure shot arrow functions even if => is on new line
1207 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1208 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1210 ([)]\s*:) | # ():
1211 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1213 ) |
1215 # arrow function possible to detect only with => on same line
1217 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1218 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1219 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1220 \s*=> # arrow operator
1222 ))
1223 ))
1224 captures:
1225 1: punctuation.accessor.ts
1226 2: punctuation.accessor.optional.ts
1227 3: entity.name.function.ts
1228 - match: '(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])'
1229 captures:
1230 1: punctuation.accessor.ts
1231 2: punctuation.accessor.optional.ts
1232 3: variable.other.constant.property.ts
1233 - match: '(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*([_$[:alpha:]][_$[:alnum:]]*)'
1234 captures:
1235 1: punctuation.accessor.ts
1236 2: punctuation.accessor.optional.ts
1237 3: variable.other.property.ts
1238 - match: "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])"
1239 scope: variable.other.constant.ts
1240 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1241 scope: variable.other.readwrite.ts
1242 if-statement:
1243 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?=\bif\s*(\(([^\(\)]|(\([^\(\)]*\)))*\))\s*(?!\{))'
1244 push:
1245 - match: '(?=;|$|\})'
1246 pop: true
1247 - include: comment
1248 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(if)\s*(\()'
1249 captures:
1250 1: keyword.control.conditional.ts
1251 2: meta.brace.round.ts
1252 push:
1253 - match: \)
1254 captures:
1255 0: meta.brace.round.ts
1256 pop: true
1257 - include: expression
1258 - match: '(?<=\))\s*\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$]))'
1259 captures:
1260 0: punctuation.definition.string.begin.ts
1261 push:
1262 - meta_scope: string.regexp.ts
1263 - match: "(/)([gimsuy]*)"
1264 captures:
1265 1: punctuation.definition.string.end.ts
1266 2: keyword.other.ts
1267 pop: true
1268 - include: regexp
1269 - include: statements
1270 import-declaration:
1271 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)(?!\s*[:\(])(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1272 captures:
1273 1: keyword.control.export.ts
1274 2: storage.modifier.ts
1275 3: keyword.control.import.ts
1276 push:
1277 - meta_scope: meta.import.ts
1278 - match: '(?<!^import|[^\._$[:alnum:]]import)(?=;|$|^)'
1279 pop: true
1280 - include: single-line-comment-consuming-line-ending
1281 - include: comment
1282 - include: string
1283 - match: '(?<=^import|[^\._$[:alnum:]]import)(?!\s*["''])'
1284 push:
1285 - match: \bfrom\b
1286 captures:
1287 0: keyword.control.from.ts
1288 pop: true
1289 - include: import-export-declaration
1290 - include: import-export-declaration
1291 import-equals-declaration:
1292 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(require)\s*(\()'
1293 captures:
1294 1: keyword.control.export.ts
1295 2: storage.modifier.ts
1296 3: keyword.control.import.ts
1297 4: variable.other.readwrite.alias.ts
1298 5: keyword.operator.assignment.ts
1299 6: keyword.control.require.ts
1300 7: meta.brace.round.ts
1301 push:
1302 - meta_scope: meta.import-equals.external.ts
1303 - match: \)
1304 captures:
1305 0: meta.brace.round.ts
1306 pop: true
1307 - include: comment
1308 - include: string
1309 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(?!require\b)'
1310 captures:
1311 1: keyword.control.export.ts
1312 2: storage.modifier.ts
1313 3: keyword.control.import.ts
1314 4: variable.other.readwrite.alias.ts
1315 5: keyword.operator.assignment.ts
1316 push:
1317 - meta_scope: meta.import-equals.internal.ts
1318 - match: (?=;|$|^)
1319 pop: true
1320 - include: single-line-comment-consuming-line-ending
1321 - include: comment
1322 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))'
1323 captures:
1324 1: entity.name.type.module.ts
1325 2: punctuation.accessor.ts
1326 3: punctuation.accessor.optional.ts
1327 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
1328 scope: variable.other.readwrite.ts
1329 import-export-block:
1330 - match: '\{'
1331 captures:
1332 0: punctuation.definition.block.ts
1333 push:
1334 - meta_scope: meta.block.ts
1335 - match: '\}'
1336 captures:
1337 0: punctuation.definition.block.ts
1338 pop: true
1339 - include: import-export-clause
1340 import-export-clause:
1341 - include: comment
1342 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bdefault)|(\*)|(\b[_$[:alpha:]][_$[:alnum:]]*))\s+(as)\s+(?:(default(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|([_$[:alpha:]][_$[:alnum:]]*))'
1343 captures:
1344 1: keyword.control.default.ts
1345 2: constant.language.import-export-all.ts
1346 3: variable.other.readwrite.ts
1347 4: keyword.control.as.ts
1348 5: keyword.control.default.ts
1349 6: variable.other.readwrite.alias.ts
1350 - include: punctuation-comma
1351 - match: \*
1352 scope: constant.language.import-export-all.ts
1353 - match: \b(default)\b
1354 scope: keyword.control.default.ts
1355 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
1356 scope: variable.other.readwrite.alias.ts
1357 import-export-declaration:
1358 - include: comment
1359 - include: string
1360 - include: import-export-block
1361 - match: \bfrom\b
1362 scope: keyword.control.from.ts
1363 - include: import-export-clause
1364 indexer-declaration:
1365 - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(readonly)\s*)?\s*(\[)\s*([_$[:alpha:]][_$[:alnum:]]*)\s*(?=:)'
1366 captures:
1367 1: storage.modifier.ts
1368 2: meta.brace.square.ts
1369 3: variable.parameter.ts
1370 push:
1371 - meta_scope: meta.indexer.declaration.ts
1372 - match: '(\])\s*(\?\s*)?|$'
1373 captures:
1374 1: meta.brace.square.ts
1375 2: keyword.operator.optional.ts
1376 pop: true
1377 - include: type-annotation
1378 indexer-mapped-type-declaration:
1379 - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))([+-])?(readonly)\s*)?\s*(\[)\s*([_$[:alpha:]][_$[:alnum:]]*)\s+(in)\s+'
1380 captures:
1381 1: keyword.operator.type.modifier.ts
1382 2: storage.modifier.ts
1383 3: meta.brace.square.ts
1384 4: entity.name.type.ts
1385 5: keyword.operator.expression.in.ts
1386 push:
1387 - meta_scope: meta.indexer.mappedtype.declaration.ts
1388 - match: '(\])([+-])?\s*(\?\s*)?|$'
1389 captures:
1390 1: meta.brace.square.ts
1391 2: keyword.operator.type.modifier.ts
1392 3: keyword.operator.optional.ts
1393 pop: true
1394 - include: type
1395 inline-tags:
1396 - match: '(\[)[^\]]+(\])(?={@(?:link|linkcode|linkplain|tutorial))'
1397 scope: constant.other.description.jsdoc
1398 captures:
1399 1: punctuation.definition.bracket.square.begin.jsdoc
1400 2: punctuation.definition.bracket.square.end.jsdoc
1401 - match: '({)((@)(?:link(?:code|plain)?|tutorial))\s*'
1402 captures:
1403 1: punctuation.definition.bracket.curly.begin.jsdoc
1404 2: storage.type.class.jsdoc
1405 3: punctuation.definition.inline.tag.jsdoc
1406 push:
1407 - meta_scope: entity.name.type.instance.jsdoc
1408 - match: '}|(?=\*/)'
1409 captures:
1410 0: punctuation.definition.bracket.curly.end.jsdoc
1411 pop: true
1412 - match: '\G((?=https?://)(?:[^|}\s*]|\*[/])+)(\|)?'
1413 captures:
1414 1: variable.other.link.underline.jsdoc
1415 2: punctuation.separator.pipe.jsdoc
1416 - match: '\G((?:[^{}@\s|*]|\*[^/])+)(\|)?'
1417 captures:
1418 1: variable.other.description.jsdoc
1419 2: punctuation.separator.pipe.jsdoc
1420 instanceof-expr:
1421 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(instanceof)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1422 captures:
1423 1: keyword.operator.expression.instanceof.ts
1424 push:
1425 - match: '(?<=\))|(?=[;),}\]:?]|\|\||\&\&|$|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))function((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))'
1426 pop: true
1427 - include: type
1428 interface-declaration:
1429 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(?:(abstract)\s+)?\b(interface)\b(?=\s+|/[/*])'
1430 captures:
1431 1: keyword.control.export.ts
1432 2: storage.modifier.ts
1433 3: storage.modifier.ts
1434 4: storage.type.interface.ts
1435 push:
1436 - meta_scope: meta.interface.ts
1437 - match: '(?<=\})'
1438 pop: true
1439 - include: comment
1440 - include: class-or-interface-heritage
1441 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1442 captures:
1443 0: entity.name.type.interface.ts
1444 - include: type-parameters
1445 - include: class-or-interface-body
1446 jsdoctype:
1447 - match: '\G{(?:[^}*]|\*[^/}])+$'
1448 scope: invalid.illegal.type.jsdoc
1449 - match: '\G({)'
1450 captures:
1451 0: entity.name.type.instance.jsdoc
1452 1: punctuation.definition.bracket.curly.begin.jsdoc
1453 push:
1454 - meta_content_scope: entity.name.type.instance.jsdoc
1455 - match: '((}))\s*|(?=\*/)'
1456 captures:
1457 1: entity.name.type.instance.jsdoc
1458 2: punctuation.definition.bracket.curly.end.jsdoc
1459 pop: true
1460 - include: brackets
1461 label:
1462 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(:)(?=\s*\{)'
1463 captures:
1464 1: entity.name.label.ts
1465 2: punctuation.separator.label.ts
1466 push:
1467 - match: '(?<=\})'
1468 pop: true
1469 - include: decl-block
1470 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(:)'
1471 captures:
1472 1: entity.name.label.ts
1473 2: punctuation.separator.label.ts
1474 literal:
1475 - include: numeric-literal
1476 - include: boolean-literal
1477 - include: null-literal
1478 - include: undefined-literal
1479 - include: numericConstant-literal
1480 - include: array-literal
1481 - include: this-literal
1482 - include: super-literal
1483 method-declaration:
1484 - match: '(?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?\s*\b(constructor)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1485 captures:
1486 1: storage.modifier.ts
1487 2: storage.modifier.ts
1488 3: storage.modifier.async.ts
1489 4: storage.type.ts
1490 push:
1491 - meta_scope: meta.method.declaration.ts
1492 - match: '(?=\}|;|,|$)|(?<=\})'
1493 pop: true
1494 - include: method-declaration-name
1495 - include: function-body
1496 - match: '(?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:(?:\s*\b(new)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|(?:(\*)\s*)?)(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])'
1497 captures:
1498 1: storage.modifier.ts
1499 2: storage.modifier.ts
1500 3: storage.modifier.async.ts
1501 4: keyword.operator.new.ts
1502 5: keyword.generator.asterisk.ts
1503 push:
1504 - meta_scope: meta.method.declaration.ts
1505 - match: '(?=\}|;|,|$)|(?<=\})'
1506 pop: true
1507 - include: method-declaration-name
1508 - include: function-body
1509 - match: |-
1510 (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1511 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1512 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1513 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1514 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1515 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1516 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1517 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1518 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1519 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1520 captures:
1521 1: storage.modifier.ts
1522 2: storage.modifier.ts
1523 3: storage.modifier.async.ts
1524 4: storage.type.property.ts
1525 5: keyword.generator.asterisk.ts
1526 push:
1527 - meta_scope: meta.method.declaration.ts
1528 - match: '(?=\}|;|,|$)|(?<=\})'
1529 pop: true
1530 - include: method-declaration-name
1531 - include: function-body
1532 method-declaration-name:
1533 - match: |-
1534 (?x)(?=((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1535 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1536 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1537 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1538 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1539 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1540 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1541 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1542 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1543 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??)\s*[\(\<])
1544 push:
1545 - match: (?=\(|\<)
1546 pop: true
1547 - include: string
1548 - include: array-literal
1549 - include: numeric-literal
1550 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1551 scope: meta.definition.method.ts entity.name.function.ts
1552 - match: \?
1553 scope: keyword.operator.optional.ts
1554 namespace-declaration:
1555 - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(namespace|module)\s+(?=[_$[:alpha:]"''`]))'
1556 captures:
1557 1: keyword.control.export.ts
1558 2: storage.modifier.ts
1559 3: storage.type.namespace.ts
1560 push:
1561 - meta_scope: meta.namespace.declaration.ts
1562 - match: '(?<=\})|(?=;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
1563 pop: true
1564 - include: comment
1565 - include: string
1566 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
1567 scope: entity.name.type.module.ts
1568 - include: punctuation-accessor
1569 - include: decl-block
1570 new-expr:
1571 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1572 captures:
1573 1: keyword.operator.new.ts
1574 push:
1575 - meta_scope: new.expr.ts
1576 - match: '(?<=\))|(?=[;),}\]:\-\+]|\|\||\&\&|$|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))new(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))function((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))'
1577 pop: true
1578 - include: paren-expression
1579 - include: class-declaration
1580 - include: type
1581 null-literal:
1582 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))null(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1583 scope: constant.language.null.ts
1584 numeric-literal:
1585 - match: '\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$)'
1586 scope: constant.numeric.hex.ts
1587 captures:
1588 1: storage.type.numeric.bigint.ts
1589 - match: '\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$)'
1590 scope: constant.numeric.binary.ts
1591 captures:
1592 1: storage.type.numeric.bigint.ts
1593 - match: '\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$)'
1594 scope: constant.numeric.octal.ts
1595 captures:
1596 1: storage.type.numeric.bigint.ts
1597 - match: |-
1598 (?x)
1599 (?<!\$)(?:
1600 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1601 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1602 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1603 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1604 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1605 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1606 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1607 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1608 )(?!\$)
1609 captures:
1610 0: constant.numeric.decimal.ts
1611 1: meta.delimiter.decimal.period.ts
1612 2: storage.type.numeric.bigint.ts
1613 3: meta.delimiter.decimal.period.ts
1614 4: storage.type.numeric.bigint.ts
1615 5: meta.delimiter.decimal.period.ts
1616 6: storage.type.numeric.bigint.ts
1617 7: storage.type.numeric.bigint.ts
1618 8: meta.delimiter.decimal.period.ts
1619 9: storage.type.numeric.bigint.ts
1620 10: meta.delimiter.decimal.period.ts
1621 11: storage.type.numeric.bigint.ts
1622 12: meta.delimiter.decimal.period.ts
1623 13: storage.type.numeric.bigint.ts
1624 14: storage.type.numeric.bigint.ts
1625 numericConstant-literal:
1626 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))NaN(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1627 scope: constant.language.nan.ts
1628 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Infinity(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1629 scope: constant.language.infinity.ts
1630 object-binding-element:
1631 - include: comment
1632 - match: |-
1633 (?x)(?=((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1634 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1635 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1636 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1637 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1638 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1639 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1640 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1641 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1642 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1643 push:
1644 - match: '(?=,|\})'
1645 pop: true
1646 - include: object-binding-element-propertyName
1647 - include: binding-element
1648 - include: object-binding-pattern
1649 - include: destructuring-variable-rest
1650 - include: variable-initializer
1651 - include: punctuation-comma
1652 object-binding-element-const:
1653 - include: comment
1654 - match: |-
1655 (?x)(?=((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1656 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1657 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1658 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1659 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1660 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1661 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1662 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1663 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1664 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1665 push:
1666 - match: '(?=,|\})'
1667 pop: true
1668 - include: object-binding-element-propertyName
1669 - include: binding-element-const
1670 - include: object-binding-pattern-const
1671 - include: destructuring-variable-rest-const
1672 - include: variable-initializer
1673 - include: punctuation-comma
1674 object-binding-element-propertyName:
1675 - match: |-
1676 (?x)(?=((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1677 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1678 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1679 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1680 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1681 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1682 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1683 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1684 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1685 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1686 push:
1687 - match: (:)
1688 captures:
1689 0: punctuation.destructuring.ts
1690 pop: true
1691 - include: string
1692 - include: array-literal
1693 - include: numeric-literal
1694 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
1695 scope: variable.object.property.ts
1696 object-binding-pattern:
1697 - match: '(?:(\.\.\.)\s*)?(\{)'
1698 captures:
1699 1: keyword.operator.rest.ts
1700 2: punctuation.definition.binding-pattern.object.ts
1701 push:
1702 - match: '\}'
1703 captures:
1704 0: punctuation.definition.binding-pattern.object.ts
1705 pop: true
1706 - include: object-binding-element
1707 object-binding-pattern-const:
1708 - match: '(?:(\.\.\.)\s*)?(\{)'
1709 captures:
1710 1: keyword.operator.rest.ts
1711 2: punctuation.definition.binding-pattern.object.ts
1712 push:
1713 - match: '\}'
1714 captures:
1715 0: punctuation.definition.binding-pattern.object.ts
1716 pop: true
1717 - include: object-binding-element-const
1718 object-identifiers:
1719 - match: '([_$[:alpha:]][_$[:alnum:]]*)(?=\s*\??\.\s*prototype\b(?!\$))'
1720 scope: support.class.ts
1721 - match: |-
1722 (?x)(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(?:
1723 ([[:upper:]][_$[:digit:][:upper:]]*) |
1724 ([_$[:alpha:]][_$[:alnum:]]*)
1725 )(?=\s*\??\.\s*[_$[:alpha:]][_$[:alnum:]]*)
1726 captures:
1727 1: punctuation.accessor.ts
1728 2: punctuation.accessor.optional.ts
1729 3: variable.other.constant.object.property.ts
1730 4: variable.other.object.property.ts
1731 - match: |-
1732 (?x)(?:
1733 ([[:upper:]][_$[:digit:][:upper:]]*) |
1734 ([_$[:alpha:]][_$[:alnum:]]*)
1735 )(?=\s*\??\.\s*[_$[:alpha:]][_$[:alnum:]]*)
1736 captures:
1737 1: variable.other.constant.object.ts
1738 2: variable.other.object.ts
1739 object-literal:
1740 - match: '\{'
1741 captures:
1742 0: punctuation.definition.block.ts
1743 push:
1744 - meta_scope: meta.objectliteral.ts
1745 - match: '\}'
1746 captures:
1747 0: punctuation.definition.block.ts
1748 pop: true
1749 - include: object-member
1750 object-literal-method-declaration:
1751 - match: |-
1752 (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1753 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1754 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1755 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1756 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1757 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1758 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1759 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1760 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1761 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1762 captures:
1763 1: storage.modifier.async.ts
1764 2: storage.type.property.ts
1765 3: keyword.generator.asterisk.ts
1766 push:
1767 - meta_scope: meta.method.declaration.ts
1768 - match: '(?=\}|;|,)|(?<=\})'
1769 pop: true
1770 - include: method-declaration-name
1771 - include: function-body
1772 - match: |-
1773 (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1774 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1775 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1776 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1777 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1778 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1779 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1780 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1781 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1782 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1783 captures:
1784 1: storage.modifier.async.ts
1785 2: storage.type.property.ts
1786 3: keyword.generator.asterisk.ts
1787 push:
1788 - match: (?=\(|\<)
1789 pop: true
1790 - include: method-declaration-name
1791 object-member:
1792 - include: comment
1793 - include: object-literal-method-declaration
1794 - match: '(?=\[)'
1795 push:
1796 - meta_scope: meta.object.member.ts meta.object-literal.key.ts
1797 - match: '(?=:)|((?<=[\]])(?=\s*[\(\<]))'
1798 pop: true
1799 - include: comment
1800 - include: array-literal
1801 - match: '(?=[\''\"\`])'
1802 push:
1803 - meta_scope: meta.object.member.ts meta.object-literal.key.ts
1804 - match: '(?=:)|((?<=[\''\"\`])(?=((\s*[\(\<,}])|(\s+(as)\s+))))'
1805 pop: true
1806 - include: comment
1807 - include: string
1808 - match: |-
1809 (?x)(?=(\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1810 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1811 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1812 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1813 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1814 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1815 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1816 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1817 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1818 )(?!\$)))
1819 push:
1820 - meta_scope: meta.object.member.ts meta.object-literal.key.ts
1821 - match: '(?=:)|(?=\s*([\(\<,}])|(\s+as\s+))'
1822 pop: true
1823 - include: comment
1824 - include: numeric-literal
1825 - match: '(?<=[\]\''\"\`])(?=\s*[\(\<])'
1826 push:
1827 - meta_scope: meta.method.declaration.ts
1828 - match: '(?=\}|;|,)|(?<=\})'
1829 pop: true
1830 - include: function-body
1831 - match: '(?![_$[:alpha:]])([[:digit:]]+)\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*:)'
1832 scope: meta.object.member.ts
1833 captures:
1834 0: meta.object-literal.key.ts
1835 1: constant.numeric.decimal.ts
1836 - match: |-
1837 (?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*:(\s*\/\*([^\*]|(\*[^\/]))*\*\/)*\s*(
1838 ((async\s+)?(
1839 (function\s*[(<*]) |
1840 (function\s+) |
1841 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1842 )) |
1843 ((async\s*)?(
1844 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1845 # sure shot arrow functions even if => is on new line
1847 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1848 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1850 ([)]\s*:) | # ():
1851 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1853 ) |
1855 # arrow function possible to detect only with => on same line
1857 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1858 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1859 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1860 \s*=> # arrow operator
1862 ))
1863 )))
1864 scope: meta.object.member.ts
1865 captures:
1866 0: meta.object-literal.key.ts
1867 1: entity.name.function.ts
1868 - match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*:)'
1869 scope: meta.object.member.ts
1870 captures:
1871 0: meta.object-literal.key.ts
1872 - match: \.\.\.
1873 captures:
1874 0: keyword.operator.spread.ts
1875 push:
1876 - meta_scope: meta.object.member.ts
1877 - match: '(?=,|\})'
1878 pop: true
1879 - include: expression
1880 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?=,|\}|$|\/\/|\/\*)'
1881 scope: meta.object.member.ts
1882 captures:
1883 1: variable.other.readwrite.ts
1884 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+(const)(?=\s*([,}]|$))'
1885 scope: meta.object.member.ts
1886 captures:
1887 1: keyword.control.as.ts
1888 2: storage.modifier.ts
1889 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+'
1890 captures:
1891 1: keyword.control.as.ts
1892 push:
1893 - meta_scope: meta.object.member.ts
1894 - match: '(?=$|^|[,}]|\|\||\&\&|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+))'
1895 pop: true
1896 - include: type
1897 - match: '(?=[_$[:alpha:]][_$[:alnum:]]*\s*=)'
1898 push:
1899 - meta_scope: meta.object.member.ts
1900 - match: '(?=,|\}|$|\/\/|\/\*)'
1901 pop: true
1902 - include: expression
1903 - match: ":"
1904 captures:
1905 0: meta.object-literal.key.ts punctuation.separator.key-value.ts
1906 push:
1907 - meta_scope: meta.object.member.ts
1908 - match: '(?=,|\})'
1909 pop: true
1910 - match: '(?<=:)\s*(async)?(?=\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)\(\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1911 captures:
1912 1: storage.modifier.async.ts
1913 push:
1914 - match: (?<=\))
1915 pop: true
1916 - include: type-parameters
1917 - match: \(
1918 captures:
1919 0: meta.brace.round.ts
1920 push:
1921 - match: \)
1922 captures:
1923 0: meta.brace.round.ts
1924 pop: true
1925 - include: expression-inside-possibly-arrow-parens
1926 - match: '(?<=:)\s*(async)?\s*(\()(?=\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1927 captures:
1928 1: storage.modifier.async.ts
1929 2: meta.brace.round.ts
1930 push:
1931 - match: \)
1932 captures:
1933 0: meta.brace.round.ts
1934 pop: true
1935 - include: expression-inside-possibly-arrow-parens
1936 - include: possibly-arrow-return-type
1937 - include: expression
1938 - include: punctuation-comma
1939 parameter-array-binding-pattern:
1940 - match: '(?:(\.\.\.)\s*)?(\[)'
1941 captures:
1942 1: keyword.operator.rest.ts
1943 2: punctuation.definition.binding-pattern.array.ts
1944 push:
1945 - match: '\]'
1946 captures:
1947 0: punctuation.definition.binding-pattern.array.ts
1948 pop: true
1949 - include: parameter-binding-element
1950 - include: punctuation-comma
1951 parameter-binding-element:
1952 - include: comment
1953 - include: string
1954 - include: numeric-literal
1955 - include: regex
1956 - include: parameter-object-binding-pattern
1957 - include: parameter-array-binding-pattern
1958 - include: destructuring-parameter-rest
1959 - include: variable-initializer
1960 parameter-name:
1961 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|protected|private|readonly)\s+(?=(public|protected|private|readonly)\s+)'
1962 captures:
1963 1: storage.modifier.ts
1964 - match: |-
1965 (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*
1966 # function assignment |
1967 (=\s*(
1968 ((async\s+)?(
1969 (function\s*[(<*]) |
1970 (function\s+) |
1971 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1972 )) |
1973 ((async\s*)?(
1974 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1975 # sure shot arrow functions even if => is on new line
1977 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1978 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1980 ([)]\s*:) | # ():
1981 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1983 ) |
1985 # arrow function possible to detect only with => on same line
1987 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1988 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1989 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1990 \s*=> # arrow operator
1992 ))
1993 )) |
1994 # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
1995 (:\s*(
1996 (<) |
1997 ([(]\s*(
1998 ([)]) |
1999 (\.\.\.) |
2000 ([_$[:alnum:]]+\s*(
2001 ([:,?=])|
2002 ([)]\s*=>)
2003 ))
2004 ))
2005 )) |
2006 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
2007 (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
2008 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
2009 ((async\s+)?(
2010 (function\s*[(<*]) |
2011 (function\s+) |
2012 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
2013 )) |
2014 ((async\s*)?(
2015 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
2016 # sure shot arrow functions even if => is on new line
2018 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
2019 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
2021 ([)]\s*:) | # ():
2022 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
2024 ) |
2026 # arrow function possible to detect only with => on same line
2028 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
2029 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
2030 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
2031 \s*=> # arrow operator
2033 ))
2034 )))
2035 captures:
2036 1: storage.modifier.ts
2037 2: keyword.operator.rest.ts
2038 3: entity.name.function.ts variable.language.this.ts
2039 4: entity.name.function.ts
2040 5: keyword.operator.optional.ts
2041 - match: '(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)'
2042 captures:
2043 1: storage.modifier.ts
2044 2: keyword.operator.rest.ts
2045 3: variable.parameter.ts variable.language.this.ts
2046 4: variable.parameter.ts
2047 5: keyword.operator.optional.ts
2048 parameter-object-binding-element:
2049 - include: comment
2050 - match: |-
2051 (?x)(?=((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
2052 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
2053 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
2054 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
2055 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
2056 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
2057 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
2058 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
2059 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
2060 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
2061 push:
2062 - match: '(?=,|\})'
2063 pop: true
2064 - include: object-binding-element-propertyName
2065 - include: parameter-binding-element
2066 - include: parameter-object-binding-pattern
2067 - include: destructuring-parameter-rest
2068 - include: variable-initializer
2069 - include: punctuation-comma
2070 parameter-object-binding-pattern:
2071 - match: '(?:(\.\.\.)\s*)?(\{)'
2072 captures:
2073 1: keyword.operator.rest.ts
2074 2: punctuation.definition.binding-pattern.object.ts
2075 push:
2076 - match: '\}'
2077 captures:
2078 0: punctuation.definition.binding-pattern.object.ts
2079 pop: true
2080 - include: parameter-object-binding-element
2081 parameter-type-annotation:
2082 - match: (:)
2083 captures:
2084 1: keyword.operator.type.annotation.ts
2085 push:
2086 - meta_scope: meta.type.annotation.ts
2087 - match: "(?=[,)])|(?==[^>])"
2088 pop: true
2089 - include: type
2090 paren-expression:
2091 - match: \(
2092 captures:
2093 0: meta.brace.round.ts
2094 push:
2095 - match: \)
2096 captures:
2097 0: meta.brace.round.ts
2098 pop: true
2099 - include: expression
2100 paren-expression-possibly-arrow:
2101 - match: '(?<=[(=,])\s*(async)?(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?\(\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
2102 captures:
2103 1: storage.modifier.async.ts
2104 push:
2105 - match: (?<=\))
2106 pop: true
2107 - include: paren-expression-possibly-arrow-with-typeparameters
2108 - match: '(?<=[(=,]|=>|^return|[^\._$[:alnum:]]return)\s*(async)?(?=\s*((((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?\()|(<))\s*$)'
2109 captures:
2110 1: storage.modifier.async.ts
2111 push:
2112 - match: (?<=\))
2113 pop: true
2114 - include: paren-expression-possibly-arrow-with-typeparameters
2115 - include: possibly-arrow-return-type
2116 paren-expression-possibly-arrow-with-typeparameters:
2117 - include: type-parameters
2118 - match: \(
2119 captures:
2120 0: meta.brace.round.ts
2121 push:
2122 - match: \)
2123 captures:
2124 0: meta.brace.round.ts
2125 pop: true
2126 - include: expression-inside-possibly-arrow-parens
2127 possibly-arrow-return-type:
2128 - match: '(?<=\)|^)\s*(:)(?=\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*=>)'
2129 captures:
2130 1: meta.arrow.ts meta.return.type.arrow.ts keyword.operator.type.annotation.ts
2131 push:
2132 - meta_content_scope: meta.arrow.ts meta.return.type.arrow.ts
2133 - match: '(?==>|\{|(^\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\s+))'
2134 pop: true
2135 - include: arrow-return-type-body
2136 property-accessor:
2137 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(get|set)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2138 scope: storage.type.property.ts
2139 punctuation-accessor:
2140 - match: '(?:(\.)|(\?\.(?!\s*[[:digit:]])))'
2141 captures:
2142 1: punctuation.accessor.ts
2143 2: punctuation.accessor.optional.ts
2144 punctuation-comma:
2145 - match: ","
2146 scope: punctuation.separator.comma.ts
2147 punctuation-semicolon:
2148 - match: ;
2149 scope: punctuation.terminator.statement.ts
2150 qstring-double:
2151 - match: '"'
2152 captures:
2153 0: punctuation.definition.string.begin.ts
2154 push:
2155 - meta_scope: string.quoted.double.ts
2156 - match: '(")|((?:[^\\\n])$)'
2157 captures:
2158 1: punctuation.definition.string.end.ts
2159 2: invalid.illegal.newline.ts
2160 pop: true
2161 - include: string-character-escape
2162 qstring-single:
2163 - match: "'"
2164 captures:
2165 0: punctuation.definition.string.begin.ts
2166 push:
2167 - meta_scope: string.quoted.single.ts
2168 - match: '(\'')|((?:[^\\\n])$)'
2169 captures:
2170 1: punctuation.definition.string.end.ts
2171 2: invalid.illegal.newline.ts
2172 pop: true
2173 - include: string-character-escape
2174 regex:
2175 - match: '(?<!\+\+|--|})(?<=[=(:,\[?+!]|^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[\()]|\\.|\[([^\]\\]|\\.)+\]|\(([^\)\\]|\\.)+\))+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$]))'
2176 captures:
2177 1: punctuation.definition.string.begin.ts
2178 push:
2179 - meta_scope: string.regexp.ts
2180 - match: "(/)([gimsuy]*)"
2181 captures:
2182 1: punctuation.definition.string.end.ts
2183 2: keyword.other.ts
2184 pop: true
2185 - include: regexp
2186 - match: '((?<![_$[:alnum:])\]]|\+\+|--|}|\*\/)|((?<=^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case))\s*)\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$]))'
2187 captures:
2188 0: punctuation.definition.string.begin.ts
2189 push:
2190 - meta_scope: string.regexp.ts
2191 - match: "(/)([gimsuy]*)"
2192 captures:
2193 1: punctuation.definition.string.end.ts
2194 2: keyword.other.ts
2195 pop: true
2196 - include: regexp
2197 regex-character-class:
2198 - match: '\\[wWsSdDtrnvf]|\.'
2199 scope: constant.other.character-class.regexp
2200 - match: '\\([0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4})'
2201 scope: constant.character.numeric.regexp
2202 - match: '\\c[A-Z]'
2203 scope: constant.character.control.regexp
2204 - match: \\.
2205 scope: constant.character.escape.backslash.regexp
2206 regexp:
2207 - match: '\\[bB]|\^|\$'
2208 scope: keyword.control.anchor.regexp
2209 - match: '\\[1-9]\d*|\\k<([a-zA-Z_$][\w$]*)>'
2210 captures:
2211 0: keyword.other.back-reference.regexp
2212 1: variable.other.regexp
2213 - match: '[?+*]|\{(\d+,\d+|\d+,|,\d+|\d+)\}\??'
2214 scope: keyword.operator.quantifier.regexp
2215 - match: \|
2216 scope: keyword.operator.or.regexp
2217 - match: (\()((\?=)|(\?!)|(\?<=)|(\?<!))
2218 captures:
2219 1: punctuation.definition.group.regexp
2220 2: punctuation.definition.group.assertion.regexp
2221 3: meta.assertion.look-ahead.regexp
2222 4: meta.assertion.negative-look-ahead.regexp
2223 5: meta.assertion.look-behind.regexp
2224 6: meta.assertion.negative-look-behind.regexp
2225 push:
2226 - meta_scope: meta.group.assertion.regexp
2227 - match: (\))
2228 captures:
2229 1: punctuation.definition.group.regexp
2230 pop: true
2231 - include: regexp
2232 - match: '\((?:(\?:)|(?:\?<([a-zA-Z_$][\w$]*)>))?'
2233 captures:
2234 0: punctuation.definition.group.regexp
2235 1: punctuation.definition.group.no-capture.regexp
2236 2: variable.other.regexp
2237 push:
2238 - meta_scope: meta.group.regexp
2239 - match: \)
2240 captures:
2241 0: punctuation.definition.group.regexp
2242 pop: true
2243 - include: regexp
2244 - match: '(\[)(\^)?'
2245 captures:
2246 1: punctuation.definition.character-class.regexp
2247 2: keyword.operator.negation.regexp
2248 push:
2249 - meta_scope: constant.other.character-class.set.regexp
2250 - match: '(\])'
2251 captures:
2252 1: punctuation.definition.character-class.regexp
2253 pop: true
2254 - match: '(?:.|(\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\c[A-Z])|(\\.))\-(?:[^\]\\]|(\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\c[A-Z])|(\\.))'
2255 scope: constant.other.character-class.range.regexp
2256 captures:
2257 1: constant.character.numeric.regexp
2258 2: constant.character.control.regexp
2259 3: constant.character.escape.backslash.regexp
2260 4: constant.character.numeric.regexp
2261 5: constant.character.control.regexp
2262 6: constant.character.escape.backslash.regexp
2263 - include: regex-character-class
2264 - include: regex-character-class
2265 return-type:
2266 - match: (?<=\))\s*(:)(?=\s*\S)
2267 captures:
2268 1: keyword.operator.type.annotation.ts
2269 push:
2270 - meta_scope: meta.return.type.ts
2271 - match: "(?<![:|&])(?=$|^|[{};,]|//)"
2272 pop: true
2273 - include: return-type-core
2274 - match: (?<=\))\s*(:)
2275 captures:
2276 1: keyword.operator.type.annotation.ts
2277 push:
2278 - meta_scope: meta.return.type.ts
2279 - match: '(?<![:|&])((?=[{};,]|//|^\s*$)|((?<=\S)(?=\s*$)))'
2280 pop: true
2281 - include: return-type-core
2282 return-type-core:
2283 - include: comment
2284 - match: '(?<=[:|&])(?=\s*\{)'
2285 push:
2286 - match: '(?<=\})'
2287 pop: true
2288 - include: type-object
2289 - include: type-predicate-operator
2290 - include: type
2291 single-line-comment-consuming-line-ending:
2292 - match: '(^[ \t]+)?((//)(?:\s*((@)internal)(?=\s|$))?)'
2293 captures:
2294 1: punctuation.whitespace.comment.leading.ts
2295 2: comment.line.double-slash.ts
2296 3: punctuation.definition.comment.ts
2297 4: storage.type.internaldeclaration.ts
2298 5: punctuation.decorator.internaldeclaration.ts
2299 push:
2300 - meta_content_scope: comment.line.double-slash.ts
2301 - match: (?=^)
2302 pop: true
2303 statements:
2304 - include: string
2305 - include: comment
2306 - include: declaration
2307 - include: control-statement
2308 - include: after-operator-block-as-object-literal
2309 - include: decl-block
2310 - include: label
2311 - include: expression
2312 - include: punctuation-semicolon
2313 string:
2314 - include: qstring-single
2315 - include: qstring-double
2316 - include: template
2317 string-character-escape:
2318 - match: '\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\{[0-9A-Fa-f]+\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)'
2319 scope: constant.character.escape.ts
2320 super-literal:
2321 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))super\b(?!\$)'
2322 scope: variable.language.super.ts
2323 support-function-call-identifiers:
2324 - include: literal
2325 - include: support-objects
2326 - include: object-identifiers
2327 - include: punctuation-accessor
2328 - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))import(?=\s*[\(]\s*[\"\''\`]))'
2329 scope: keyword.operator.expression.import.ts
2330 support-objects:
2331 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(arguments)\b(?!\$)'
2332 scope: variable.language.arguments.ts
2333 - match: |-
2334 (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(Array|ArrayBuffer|Atomics|BigInt|BigInt64Array|BigUint64Array|Boolean|DataView|Date|Float32Array
2335 |Float64Array|Function|Generator|GeneratorFunction|Int8Array|Int16Array|Int32Array|Intl|Map|Number|Object|Proxy
2336 |Reflect|RegExp|Set|SharedArrayBuffer|SIMD|String|Symbol|TypedArray
2337 |Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|WeakMap|WeakSet)\b(?!\$)
2338 scope: support.class.builtin.ts
2339 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))((Eval|Internal|Range|Reference|Syntax|Type|URI)?Error)\b(?!\$)'
2340 scope: support.class.error.ts
2341 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(Promise)\b(?!\$)'
2342 scope: support.class.promise.ts
2343 - match: |-
2344 (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(clear(Interval|Timeout)|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|
2345 isFinite|isNaN|parseFloat|parseInt|require|set(Interval|Timeout)|super|unescape|uneval)(?=\s*\()
2346 scope: support.function.ts
2347 - match: |-
2348 (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(Math)(?:\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(?:
2349 (abs|acos|acosh|asin|asinh|atan|atan2|atanh|cbrt|ceil|clz32|cos|cosh|exp|
2350 expm1|floor|fround|hypot|imul|log|log10|log1p|log2|max|min|pow|random|
2351 round|sign|sin|sinh|sqrt|tan|tanh|trunc)
2353 (E|LN10|LN2|LOG10E|LOG2E|PI|SQRT1_2|SQRT2)))?\b(?!\$)
2354 captures:
2355 1: support.constant.math.ts
2356 2: punctuation.accessor.ts
2357 3: punctuation.accessor.optional.ts
2358 4: support.function.math.ts
2359 5: support.constant.property.math.ts
2360 - match: |-
2361 (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(console)(?:\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(
2362 assert|clear|count|debug|dir|error|group|groupCollapsed|groupEnd|info|log
2363 |profile|profileEnd|table|time|timeEnd|timeStamp|trace|warn))?\b(?!\$)
2364 captures:
2365 1: support.class.console.ts
2366 2: punctuation.accessor.ts
2367 3: punctuation.accessor.optional.ts
2368 4: support.function.console.ts
2369 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(JSON)(?:\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(parse|stringify))?\b(?!\$)'
2370 captures:
2371 1: support.constant.json.ts
2372 2: punctuation.accessor.ts
2373 3: punctuation.accessor.optional.ts
2374 4: support.function.json.ts
2375 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(import)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(meta)\b(?!\$)'
2376 captures:
2377 1: keyword.control.import.ts
2378 2: punctuation.accessor.ts
2379 3: punctuation.accessor.optional.ts
2380 4: support.variable.property.importmeta.ts
2381 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(target)\b(?!\$)'
2382 captures:
2383 1: keyword.operator.new.ts
2384 2: punctuation.accessor.ts
2385 3: punctuation.accessor.optional.ts
2386 4: support.variable.property.target.ts
2387 - match: |-
2388 (?x) (?:(\.)|(\?\.(?!\s*[[:digit:]]))) \s* (?:
2389 (?:(constructor|length|prototype|__proto__)\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?\())
2391 (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\b(?!\$)))
2392 captures:
2393 1: punctuation.accessor.ts
2394 2: punctuation.accessor.optional.ts
2395 3: support.variable.property.ts
2396 4: support.constant.ts
2397 - match: |-
2398 (?x) (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.)) \b (?:
2399 (document|event|navigator|performance|screen|window)
2401 (AnalyserNode|ArrayBufferView|Attr|AudioBuffer|AudioBufferSourceNode|AudioContext|AudioDestinationNode|AudioListener
2402 |AudioNode|AudioParam|BatteryManager|BeforeUnloadEvent|BiquadFilterNode|Blob|BufferSource|ByteString|CSS|CSSConditionRule
2403 |CSSCounterStyleRule|CSSGroupingRule|CSSMatrix|CSSMediaRule|CSSPageRule|CSSPrimitiveValue|CSSRule|CSSRuleList|CSSStyleDeclaration
2404 |CSSStyleRule|CSSStyleSheet|CSSSupportsRule|CSSValue|CSSValueList|CanvasGradient|CanvasImageSource|CanvasPattern
2405 |CanvasRenderingContext2D|ChannelMergerNode|ChannelSplitterNode|CharacterData|ChromeWorker|CloseEvent|Comment|CompositionEvent
2406 |Console|ConvolverNode|Coordinates|Credential|CredentialsContainer|Crypto|CryptoKey|CustomEvent|DOMError|DOMException
2407 |DOMHighResTimeStamp|DOMImplementation|DOMString|DOMStringList|DOMStringMap|DOMTimeStamp|DOMTokenList|DataTransfer
2408 |DataTransferItem|DataTransferItemList|DedicatedWorkerGlobalScope|DelayNode|DeviceProximityEvent|DirectoryEntry
2409 |DirectoryEntrySync|DirectoryReader|DirectoryReaderSync|Document|DocumentFragment|DocumentTouch|DocumentType|DragEvent
2410 |DynamicsCompressorNode|Element|Entry|EntrySync|ErrorEvent|Event|EventListener|EventSource|EventTarget|FederatedCredential
2411 |FetchEvent|File|FileEntry|FileEntrySync|FileException|FileList|FileReader|FileReaderSync|FileSystem|FileSystemSync
2412 |FontFace|FormData|GainNode|Gamepad|GamepadButton|GamepadEvent|Geolocation|GlobalEventHandlers|HTMLAnchorElement
2413 |HTMLAreaElement|HTMLAudioElement|HTMLBRElement|HTMLBaseElement|HTMLBodyElement|HTMLButtonElement|HTMLCanvasElement
2414 |HTMLCollection|HTMLContentElement|HTMLDListElement|HTMLDataElement|HTMLDataListElement|HTMLDialogElement|HTMLDivElement
2415 |HTMLDocument|HTMLElement|HTMLEmbedElement|HTMLFieldSetElement|HTMLFontElement|HTMLFormControlsCollection|HTMLFormElement
2416 |HTMLHRElement|HTMLHeadElement|HTMLHeadingElement|HTMLHtmlElement|HTMLIFrameElement|HTMLImageElement|HTMLInputElement
2417 |HTMLKeygenElement|HTMLLIElement|HTMLLabelElement|HTMLLegendElement|HTMLLinkElement|HTMLMapElement|HTMLMediaElement
2418 |HTMLMetaElement|HTMLMeterElement|HTMLModElement|HTMLOListElement|HTMLObjectElement|HTMLOptGroupElement|HTMLOptionElement
2419 |HTMLOptionsCollection|HTMLOutputElement|HTMLParagraphElement|HTMLParamElement|HTMLPreElement|HTMLProgressElement
2420 |HTMLQuoteElement|HTMLScriptElement|HTMLSelectElement|HTMLShadowElement|HTMLSourceElement|HTMLSpanElement|HTMLStyleElement
2421 |HTMLTableCaptionElement|HTMLTableCellElement|HTMLTableColElement|HTMLTableDataCellElement|HTMLTableElement|HTMLTableHeaderCellElement
2422 |HTMLTableRowElement|HTMLTableSectionElement|HTMLTextAreaElement|HTMLTimeElement|HTMLTitleElement|HTMLTrackElement
2423 |HTMLUListElement|HTMLUnknownElement|HTMLVideoElement|HashChangeEvent|History|IDBCursor|IDBCursorWithValue|IDBDatabase
2424 |IDBEnvironment|IDBFactory|IDBIndex|IDBKeyRange|IDBMutableFile|IDBObjectStore|IDBOpenDBRequest|IDBRequest|IDBTransaction
2425 |IDBVersionChangeEvent|IIRFilterNode|IdentityManager|ImageBitmap|ImageBitmapFactories|ImageData|Index|InputDeviceCapabilities
2426 |InputEvent|InstallEvent|InstallTrigger|KeyboardEvent|LinkStyle|LocalFileSystem|LocalFileSystemSync|Location|MIDIAccess
2427 |MIDIConnectionEvent|MIDIInput|MIDIInputMap|MIDIOutputMap|MediaElementAudioSourceNode|MediaError|MediaKeyMessageEvent
2428 |MediaKeySession|MediaKeyStatusMap|MediaKeySystemAccess|MediaKeySystemConfiguration|MediaKeys|MediaRecorder|MediaStream
2429 |MediaStreamAudioDestinationNode|MediaStreamAudioSourceNode|MessageChannel|MessageEvent|MessagePort|MouseEvent
2430 |MutationObserver|MutationRecord|NamedNodeMap|Navigator|NavigatorConcurrentHardware|NavigatorGeolocation|NavigatorID
2431 |NavigatorLanguage|NavigatorOnLine|Node|NodeFilter|NodeIterator|NodeList|NonDocumentTypeChildNode|Notification
2432 |OfflineAudioCompletionEvent|OfflineAudioContext|OscillatorNode|PageTransitionEvent|PannerNode|ParentNode|PasswordCredential
2433 |Path2D|PaymentAddress|PaymentRequest|PaymentResponse|Performance|PerformanceEntry|PerformanceFrameTiming|PerformanceMark
2434 |PerformanceMeasure|PerformanceNavigation|PerformanceNavigationTiming|PerformanceObserver|PerformanceObserverEntryList
2435 |PerformanceResourceTiming|PerformanceTiming|PeriodicSyncEvent|PeriodicWave|Plugin|Point|PointerEvent|PopStateEvent
2436 |PortCollection|Position|PositionError|PositionOptions|PresentationConnectionClosedEvent|PresentationConnectionList
2437 |PresentationReceiver|ProcessingInstruction|ProgressEvent|PromiseRejectionEvent|PushEvent|PushRegistrationManager
2438 |RTCCertificate|RTCConfiguration|RTCPeerConnection|RTCSessionDescriptionCallback|RTCStatsReport|RadioNodeList|RandomSource
2439 |Range|ReadableByteStream|RenderingContext|SVGAElement|SVGAngle|SVGAnimateColorElement|SVGAnimateElement|SVGAnimateMotionElement
2440 |SVGAnimateTransformElement|SVGAnimatedAngle|SVGAnimatedBoolean|SVGAnimatedEnumeration|SVGAnimatedInteger|SVGAnimatedLength
2441 |SVGAnimatedLengthList|SVGAnimatedNumber|SVGAnimatedNumberList|SVGAnimatedPoints|SVGAnimatedPreserveAspectRatio
2442 |SVGAnimatedRect|SVGAnimatedString|SVGAnimatedTransformList|SVGAnimationElement|SVGCircleElement|SVGClipPathElement
2443 |SVGCursorElement|SVGDefsElement|SVGDescElement|SVGElement|SVGEllipseElement|SVGEvent|SVGFilterElement|SVGFontElement
2444 |SVGFontFaceElement|SVGFontFaceFormatElement|SVGFontFaceNameElement|SVGFontFaceSrcElement|SVGFontFaceUriElement
2445 |SVGForeignObjectElement|SVGGElement|SVGGlyphElement|SVGGradientElement|SVGHKernElement|SVGImageElement|SVGLength
2446 |SVGLengthList|SVGLineElement|SVGLinearGradientElement|SVGMPathElement|SVGMaskElement|SVGMatrix|SVGMissingGlyphElement
2447 |SVGNumber|SVGNumberList|SVGPathElement|SVGPatternElement|SVGPoint|SVGPolygonElement|SVGPolylineElement|SVGPreserveAspectRatio
2448 |SVGRadialGradientElement|SVGRect|SVGRectElement|SVGSVGElement|SVGScriptElement|SVGSetElement|SVGStopElement|SVGStringList
2449 |SVGStylable|SVGStyleElement|SVGSwitchElement|SVGSymbolElement|SVGTRefElement|SVGTSpanElement|SVGTests|SVGTextElement
2450 |SVGTextPositioningElement|SVGTitleElement|SVGTransform|SVGTransformList|SVGTransformable|SVGUseElement|SVGVKernElement
2451 |SVGViewElement|ServiceWorker|ServiceWorkerContainer|ServiceWorkerGlobalScope|ServiceWorkerRegistration|ServiceWorkerState
2452 |ShadowRoot|SharedWorker|SharedWorkerGlobalScope|SourceBufferList|StereoPannerNode|Storage|StorageEvent|StyleSheet
2453 |StyleSheetList|SubtleCrypto|SyncEvent|Text|TextMetrics|TimeEvent|TimeRanges|Touch|TouchEvent|TouchList|Transferable
2454 |TreeWalker|UIEvent|USVString|VRDisplayCapabilities|ValidityState|WaveShaperNode|WebGL|WebGLActiveInfo|WebGLBuffer
2455 |WebGLContextEvent|WebGLFramebuffer|WebGLProgram|WebGLRenderbuffer|WebGLRenderingContext|WebGLShader|WebGLShaderPrecisionFormat
2456 |WebGLTexture|WebGLTimerQueryEXT|WebGLTransformFeedback|WebGLUniformLocation|WebGLVertexArrayObject|WebGLVertexArrayObjectOES
2457 |WebSocket|WebSockets|WebVTT|WheelEvent|Window|WindowBase64|WindowEventHandlers|WindowTimers|Worker|WorkerGlobalScope
2458 |WorkerLocation|WorkerNavigator|XMLHttpRequest|XMLHttpRequestEventTarget|XMLSerializer|XPathExpression|XPathResult
2459 |XSLTProcessor))\b(?!\$)
2460 captures:
2461 1: support.variable.dom.ts
2462 2: support.class.dom.ts
2463 - match: |-
2464 (?x) (?:(\.)|(\?\.(?!\s*[[:digit:]]))) \s* (?:
2465 (ATTRIBUTE_NODE|CDATA_SECTION_NODE|COMMENT_NODE|DOCUMENT_FRAGMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE
2466 |DOMSTRING_SIZE_ERR|ELEMENT_NODE|ENTITY_NODE|ENTITY_REFERENCE_NODE|HIERARCHY_REQUEST_ERR|INDEX_SIZE_ERR
2467 |INUSE_ATTRIBUTE_ERR|INVALID_CHARACTER_ERR|NO_DATA_ALLOWED_ERR|NO_MODIFICATION_ALLOWED_ERR|NOT_FOUND_ERR
2468 |NOT_SUPPORTED_ERR|NOTATION_NODE|PROCESSING_INSTRUCTION_NODE|TEXT_NODE|WRONG_DOCUMENT_ERR)
2470 (_content|[xyz]|abbr|above|accept|acceptCharset|accessKey|action|align|[av]Link(?:color)?|all|alt|anchors|appCodeName
2471 |appCore|applets|appMinorVersion|appName|appVersion|archive|areas|arguments|attributes|availHeight|availLeft|availTop
2472 |availWidth|axis|background|backgroundColor|backgroundImage|below|bgColor|body|border|borderBottomWidth|borderColor
2473 |borderLeftWidth|borderRightWidth|borderStyle|borderTopWidth|borderWidth|bottom|bufferDepth|callee|caller|caption
2474 |cellPadding|cells|cellSpacing|ch|characterSet|charset|checked|childNodes|chOff|cite|classes|className|clear
2475 |clientInformation|clip|clipBoardData|closed|code|codeBase|codeType|color|colorDepth|cols|colSpan|compact|complete
2476 |components|content|controllers|cookie|cookieEnabled|cords|cpuClass|crypto|current|data|dateTime|declare|defaultCharset
2477 |defaultChecked|defaultSelected|defaultStatus|defaultValue|defaultView|defer|description|dialogArguments|dialogHeight
2478 |dialogLeft|dialogTop|dialogWidth|dir|directories|disabled|display|docmain|doctype|documentElement|elements|embeds
2479 |enabledPlugin|encoding|enctype|entities|event|expando|external|face|fgColor|filename|firstChild|fontFamily|fontSize
2480 |fontWeight|form|formName|forms|frame|frameBorder|frameElement|frames|hasFocus|hash|headers|height|history|host
2481 |hostname|href|hreflang|hspace|htmlFor|httpEquiv|id|ids|ignoreCase|images|implementation|index|innerHeight|innerWidth
2482 |input|isMap|label|lang|language|lastChild|lastIndex|lastMatch|lastModified|lastParen|layer[sXY]|left|leftContext
2483 |lineHeight|link|linkColor|links|listStyleType|localName|location|locationbar|longDesc|lowsrc|lowSrc|marginBottom
2484 |marginHeight|marginLeft|marginRight|marginTop|marginWidth|maxLength|media|menubar|method|mimeTypes|multiline|multiple
2485 |name|nameProp|namespaces|namespaceURI|next|nextSibling|nodeName|nodeType|nodeValue|noHref|noResize|noShade|notationName
2486 |notations|noWrap|object|offscreenBuffering|onLine|onreadystatechange|opener|opsProfile|options|oscpu|outerHeight
2487 |outerWidth|ownerDocument|paddingBottom|paddingLeft|paddingRight|paddingTop|page[XY]|page[XY]Offset|parent|parentLayer
2488 |parentNode|parentWindow|pathname|personalbar|pixelDepth|pkcs11|platform|plugins|port|prefix|previous|previousDibling
2489 |product|productSub|profile|profileend|prompt|prompter|protocol|publicId|readOnly|readyState|referrer|rel|responseText
2490 |responseXML|rev|right|rightContext|rowIndex|rows|rowSpan|rules|scheme|scope|screen[XY]|screenLeft|screenTop|scripts
2491 |scrollbars|scrolling|sectionRowIndex|security|securityPolicy|selected|selectedIndex|selection|self|shape|siblingAbove
2492 |siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary
2493 |systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead
2494 |title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile
2495 |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?\()
2496 captures:
2497 1: punctuation.accessor.ts
2498 2: punctuation.accessor.optional.ts
2499 3: support.constant.dom.ts
2500 4: support.variable.property.dom.ts
2501 - match: |-
2502 (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(Buffer|EventEmitter|Server|Pipe|Socket|REPLServer|ReadStream|WriteStream|Stream
2503 |Inflate|Deflate|InflateRaw|DeflateRaw|GZip|GUnzip|Unzip|Zip)\b(?!\$)
2504 scope: support.class.node.ts
2505 - match: |-
2506 (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(process)(?:(?:(\.)|(\?\.(?!\s*[[:digit:]])))(?:
2507 (arch|argv|config|connected|env|execArgv|execPath|exitCode|mainModule|pid|platform|release|stderr|stdin|stdout|title|version|versions)
2509 (abort|chdir|cwd|disconnect|exit|[sg]ete?[gu]id|send|[sg]etgroups|initgroups|kill|memoryUsage|nextTick|umask|uptime|hrtime)
2510 ))?\b(?!\$)
2511 captures:
2512 1: support.variable.object.process.ts
2513 2: punctuation.accessor.ts
2514 3: punctuation.accessor.optional.ts
2515 4: support.variable.property.process.ts
2516 5: support.function.process.ts
2517 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(exports)|(module)(?:(?:(\.)|(\?\.(?!\s*[[:digit:]])))(exports|id|filename|loaded|parent|children))?)\b(?!\$)'
2518 captures:
2519 1: support.type.object.module.ts
2520 2: support.type.object.module.ts
2521 3: punctuation.accessor.ts
2522 4: punctuation.accessor.optional.ts
2523 5: support.type.object.module.ts
2524 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(global|GLOBAL|root|__dirname|__filename)\b(?!\$)'
2525 scope: support.variable.object.node.ts
2526 - match: |-
2527 (?x) (?:(\.)|(\?\.(?!\s*[[:digit:]]))) \s*
2528 (?:
2529 (on(?:Rowsinserted|Rowsdelete|Rowenter|Rowexit|Resize|Resizestart|Resizeend|Reset|
2530 Readystatechange|Mouseout|Mouseover|Mousedown|Mouseup|Mousemove|
2531 Before(?:cut|deactivate|unload|update|paste|print|editfocus|activate)|
2532 Blur|Scrolltop|Submit|Select|Selectstart|Selectionchange|Hover|Help|
2533 Change|Contextmenu|Controlselect|Cut|Cellchange|Clock|Close|Deactivate|
2534 Datasetchanged|Datasetcomplete|Dataavailable|Drop|Drag|Dragstart|Dragover|
2535 Dragdrop|Dragenter|Dragend|Dragleave|Dblclick|Unload|Paste|Propertychange|Error|
2536 Errorupdate|Keydown|Keyup|Keypress|Focus|Load|Activate|Afterupdate|Afterprint|Abort)
2537 ) |
2538 (shift|showModelessDialog|showModalDialog|showHelp|scroll|scrollX|scrollByPages|
2539 scrollByLines|scrollY|scrollTo|stop|strike|sizeToContent|sidebar|signText|sort|
2540 sup|sub|substr|substring|splice|split|send|set(?:Milliseconds|Seconds|Minutes|Hours|
2541 Month|Year|FullYear|Date|UTC(?:Milliseconds|Seconds|Minutes|Hours|Month|FullYear|Date)|
2542 Time|Hotkeys|Cursor|ZOptions|Active|Resizable|RequestHeader)|search|slice|
2543 savePreferences|small|home|handleEvent|navigate|char|charCodeAt|charAt|concat|
2544 contextual|confirm|compile|clear|captureEvents|call|createStyleSheet|createPopup|
2545 createEventObject|to(?:GMTString|UTCString|String|Source|UpperCase|LowerCase|LocaleString)|
2546 test|taint|taintEnabled|indexOf|italics|disableExternalCapture|dump|detachEvent|unshift|
2547 untaint|unwatch|updateCommands|join|javaEnabled|pop|push|plugins.refresh|paddings|parse|
2548 print|prompt|preference|enableExternalCapture|exec|execScript|valueOf|UTC|find|file|
2549 fileModifiedDate|fileSize|fileCreatedDate|fileUpdatedDate|fixed|fontsize|fontcolor|
2550 forward|fromCharCode|watch|link|load|lastIndexOf|anchor|attachEvent|atob|apply|alert|
2551 abort|routeEvents|resize|resizeBy|resizeTo|recalc|returnValue|replace|reverse|reload|
2552 releaseCapture|releaseEvents|go|get(?:Milliseconds|Seconds|Minutes|Hours|Month|Day|Year|FullYear|
2553 Time|Date|TimezoneOffset|UTC(?:Milliseconds|Seconds|Minutes|Hours|Day|Month|FullYear|Date)|
2554 Attention|Selection|ResponseHeader|AllResponseHeaders)|moveBy|moveBelow|moveTo|
2555 moveToAbsolute|moveAbove|mergeAttributes|match|margins|btoa|big|bold|borderWidths|blink|back
2556 ) |
2557 (acceptNode|add|addEventListener|addTextTrack|adoptNode|after|animate|append|
2558 appendChild|appendData|before|blur|canPlayType|captureStream|
2559 caretPositionFromPoint|caretRangeFromPoint|checkValidity|clear|click|
2560 cloneContents|cloneNode|cloneRange|close|closest|collapse|
2561 compareBoundaryPoints|compareDocumentPosition|comparePoint|contains|
2562 convertPointFromNode|convertQuadFromNode|convertRectFromNode|createAttribute|
2563 createAttributeNS|createCaption|createCDATASection|createComment|
2564 createContextualFragment|createDocument|createDocumentFragment|
2565 createDocumentType|createElement|createElementNS|createEntityReference|
2566 createEvent|createExpression|createHTMLDocument|createNodeIterator|
2567 createNSResolver|createProcessingInstruction|createRange|createShadowRoot|
2568 createTBody|createTextNode|createTFoot|createTHead|createTreeWalker|delete|
2569 deleteCaption|deleteCell|deleteContents|deleteData|deleteRow|deleteTFoot|
2570 deleteTHead|detach|disconnect|dispatchEvent|elementFromPoint|elementsFromPoint|
2571 enableStyleSheetsForSet|entries|evaluate|execCommand|exitFullscreen|
2572 exitPointerLock|expand|extractContents|fastSeek|firstChild|focus|forEach|get|
2573 getAll|getAnimations|getAttribute|getAttributeNames|getAttributeNode|
2574 getAttributeNodeNS|getAttributeNS|getBoundingClientRect|getBoxQuads|
2575 getClientRects|getContext|getDestinationInsertionPoints|getElementById|
2576 getElementsByClassName|getElementsByName|getElementsByTagName|
2577 getElementsByTagNameNS|getItem|getNamedItem|getSelection|getStartDate|
2578 getVideoPlaybackQuality|has|hasAttribute|hasAttributeNS|hasAttributes|
2579 hasChildNodes|hasFeature|hasFocus|importNode|initEvent|insertAdjacentElement|
2580 insertAdjacentHTML|insertAdjacentText|insertBefore|insertCell|insertData|
2581 insertNode|insertRow|intersectsNode|isDefaultNamespace|isEqualNode|
2582 isPointInRange|isSameNode|item|key|keys|lastChild|load|lookupNamespaceURI|
2583 lookupPrefix|matches|move|moveAttribute|moveAttributeNode|moveChild|
2584 moveNamedItem|namedItem|nextNode|nextSibling|normalize|observe|open|
2585 parentNode|pause|play|postMessage|prepend|preventDefault|previousNode|
2586 previousSibling|probablySupportsContext|queryCommandEnabled|
2587 queryCommandIndeterm|queryCommandState|queryCommandSupported|queryCommandValue|
2588 querySelector|querySelectorAll|registerContentHandler|registerElement|
2589 registerProtocolHandler|releaseCapture|releaseEvents|remove|removeAttribute|
2590 removeAttributeNode|removeAttributeNS|removeChild|removeEventListener|
2591 removeItem|replace|replaceChild|replaceData|replaceWith|reportValidity|
2592 requestFullscreen|requestPointerLock|reset|scroll|scrollBy|scrollIntoView|
2593 scrollTo|seekToNextFrame|select|selectNode|selectNodeContents|set|setAttribute|
2594 setAttributeNode|setAttributeNodeNS|setAttributeNS|setCapture|
2595 setCustomValidity|setEnd|setEndAfter|setEndBefore|setItem|setNamedItem|
2596 setRangeText|setSelectionRange|setSinkId|setStart|setStartAfter|setStartBefore|
2597 slice|splitText|stepDown|stepUp|stopImmediatePropagation|stopPropagation|
2598 submit|substringData|supports|surroundContents|takeRecords|terminate|toBlob|
2599 toDataURL|toggle|toString|values|write|writeln
2600 ) |
2601 (all|catch|finally|race|reject|resolve|then
2603 )(?=\s*\()
2604 captures:
2605 1: punctuation.accessor.ts
2606 2: punctuation.accessor.optional.ts
2607 3: support.function.event-handler.ts
2608 4: support.function.ts
2609 5: support.function.dom.ts
2610 6: support.function.promise.ts
2611 switch-statement:
2612 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?=\bswitch\s*\()'
2613 push:
2614 - meta_scope: switch-statement.expr.ts
2615 - match: '\}'
2616 captures:
2617 0: punctuation.definition.block.ts
2618 pop: true
2619 - include: comment
2620 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(switch)\s*(\()'
2621 captures:
2622 1: keyword.control.switch.ts
2623 2: meta.brace.round.ts
2624 push:
2625 - meta_scope: switch-expression.expr.ts
2626 - match: \)
2627 captures:
2628 0: meta.brace.round.ts
2629 pop: true
2630 - include: expression
2631 - match: '\{'
2632 captures:
2633 0: punctuation.definition.block.ts
2634 push:
2635 - meta_scope: switch-block.expr.ts
2636 - match: '(?=\})'
2637 pop: true
2638 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(case|default(?=:))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2639 captures:
2640 1: keyword.control.switch.ts
2641 push:
2642 - meta_scope: case-clause.expr.ts
2643 - match: (?=:)
2644 pop: true
2645 - include: expression
2646 - match: '(:)\s*(\{)'
2647 captures:
2648 1: case-clause.expr.ts punctuation.definition.section.case-statement.ts
2649 2: meta.block.ts punctuation.definition.block.ts
2650 push:
2651 - meta_content_scope: meta.block.ts
2652 - match: '\}'
2653 captures:
2654 0: meta.block.ts punctuation.definition.block.ts
2655 pop: true
2656 - include: statements
2657 - match: (:)
2658 captures:
2659 0: case-clause.expr.ts punctuation.definition.section.case-statement.ts
2660 - include: statements
2661 template:
2662 - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`)'
2663 push:
2664 - meta_scope: string.template.ts
2665 - match: (?=`)
2666 pop: true
2667 - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))'
2668 push:
2669 - match: '(?=(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`)'
2670 pop: true
2671 - include: support-function-call-identifiers
2672 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
2673 scope: entity.name.function.tagged-template.ts
2674 - include: type-arguments
2675 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?=(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)`)'
2676 captures:
2677 1: entity.name.function.tagged-template.ts
2678 push:
2679 - meta_scope: string.template.ts
2680 - match: (?=`)
2681 pop: true
2682 - include: type-arguments
2683 - match: "([_$[:alpha:]][_$[:alnum:]]*)?(`)"
2684 captures:
2685 1: entity.name.function.tagged-template.ts
2686 2: punctuation.definition.string.template.begin.ts
2687 push:
2688 - meta_scope: string.template.ts
2689 - match: "`"
2690 captures:
2691 0: punctuation.definition.string.template.end.ts
2692 pop: true
2693 - include: template-substitution-element
2694 - include: string-character-escape
2695 template-substitution-element:
2696 - match: '\$\{'
2697 captures:
2698 0: punctuation.definition.template-expression.begin.ts
2699 push:
2700 - meta_scope: meta.template.expression.ts
2701 - meta_content_scope: meta.embedded.line.ts
2702 - match: '\}'
2703 captures:
2704 0: punctuation.definition.template-expression.end.ts
2705 pop: true
2706 - include: expression
2707 ternary-expression:
2708 - match: '(?!\?\.\s*[^[:digit:]])(\?)(?!\?)'
2709 captures:
2710 1: keyword.operator.ternary.ts
2711 push:
2712 - match: \s*(:)
2713 captures:
2714 1: keyword.operator.ternary.ts
2715 pop: true
2716 - include: expression
2717 this-literal:
2718 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))this\b(?!\$)'
2719 scope: variable.language.this.ts
2720 type:
2721 - include: comment
2722 - include: string
2723 - include: numeric-literal
2724 - include: type-primitive
2725 - include: type-builtin-literals
2726 - include: type-parameters
2727 - include: type-tuple
2728 - include: type-object
2729 - include: type-conditional
2730 - include: type-operators
2731 - include: type-fn-type-parameters
2732 - include: type-paren-or-function-parameters
2733 - include: type-function-return-type
2734 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(readonly)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
2735 captures:
2736 1: storage.modifier.ts
2737 - include: type-name
2738 type-alias-declaration:
2739 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(type)\b\s+([_$[:alpha:]][_$[:alnum:]]*)\s*'
2740 captures:
2741 1: keyword.control.export.ts
2742 2: storage.modifier.ts
2743 3: storage.type.type.ts
2744 4: entity.name.type.alias.ts
2745 push:
2746 - meta_scope: meta.type.declaration.ts
2747 - match: '(?=\}|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
2748 pop: true
2749 - include: comment
2750 - include: type-parameters
2751 - match: (=)\s*
2752 captures:
2753 1: keyword.operator.assignment.ts
2754 push:
2755 - match: '(?=\}|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
2756 pop: true
2757 - include: type
2758 type-annotation:
2759 - match: (:)(?=\s*\S)
2760 captures:
2761 1: keyword.operator.type.annotation.ts
2762 push:
2763 - meta_scope: meta.type.annotation.ts
2764 - match: '(?<![:|&])((?=$|^|[,);\}\]]|//)|(?==[^>])|((?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)))'
2765 pop: true
2766 - include: type
2767 - match: (:)
2768 captures:
2769 1: keyword.operator.type.annotation.ts
2770 push:
2771 - meta_scope: meta.type.annotation.ts
2772 - match: '(?<![:|&])((?=[,);\}\]]|//)|(?==[^>])|(?=^\s*$)|((?<=\S)(?=\s*$))|((?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)))'
2773 pop: true
2774 - include: type
2775 type-arguments:
2776 - match: \<
2777 captures:
2778 0: punctuation.definition.typeparameters.begin.ts
2779 push:
2780 - meta_scope: meta.type.parameters.ts
2781 - match: \>
2782 captures:
2783 0: punctuation.definition.typeparameters.end.ts
2784 pop: true
2785 - include: type-arguments-body
2786 type-arguments-body:
2787 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(_)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2788 captures:
2789 0: keyword.operator.type.ts
2790 - include: type
2791 - include: punctuation-comma
2792 type-builtin-literals:
2793 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(this|true|false|undefined|null|object)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2794 scope: support.type.builtin.ts
2795 type-conditional:
2796 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(extends)\s+'
2797 captures:
2798 1: storage.modifier.ts
2799 push:
2800 - match: (?<=:)
2801 pop: true
2802 - match: \?
2803 captures:
2804 0: keyword.operator.ternary.ts
2805 push:
2806 - match: ":"
2807 captures:
2808 0: keyword.operator.ternary.ts
2809 pop: true
2810 - include: type
2811 - include: type
2812 type-fn-type-parameters:
2813 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\b(?=\s*\<)'
2814 captures:
2815 1: meta.type.constructor.ts keyword.control.new.ts
2816 push:
2817 - match: (?<=>)
2818 pop: true
2819 - include: comment
2820 - include: type-parameters
2821 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\b\s*(?=\()'
2822 captures:
2823 1: keyword.control.new.ts
2824 push:
2825 - meta_scope: meta.type.constructor.ts
2826 - match: (?<=\))
2827 pop: true
2828 - include: function-parameters
2829 - match: |-
2830 (?x)(
2831 (?=
2832 [(]\s*(
2833 ([)]) |
2834 (\.\.\.) |
2835 ([_$[:alnum:]]+\s*(
2836 ([:,?=])|
2837 ([)]\s*=>)
2838 ))
2842 push:
2843 - meta_scope: meta.type.function.ts
2844 - match: (?<=\))
2845 pop: true
2846 - include: function-parameters
2847 type-function-return-type:
2848 - match: (=>)(?=\s*\S)
2849 captures:
2850 1: storage.type.function.arrow.ts
2851 push:
2852 - meta_scope: meta.type.function.return.ts
2853 - match: '(?<!=>)(?<![|&])(?=[,\]\)\{\}=;>:\?]|//|$)'
2854 pop: true
2855 - include: type-function-return-type-core
2856 - match: "=>"
2857 captures:
2858 0: storage.type.function.arrow.ts
2859 push:
2860 - meta_scope: meta.type.function.return.ts
2861 - match: '(?<!=>)(?<![|&])((?=[,\]\)\{\}=;:\?>]|//|^\s*$)|((?<=\S)(?=\s*$)))'
2862 pop: true
2863 - include: type-function-return-type-core
2864 type-function-return-type-core:
2865 - include: comment
2866 - match: '(?<==>)(?=\s*\{)'
2867 push:
2868 - match: '(?<=\})'
2869 pop: true
2870 - include: type-object
2871 - include: type-predicate-operator
2872 - include: type
2873 type-name:
2874 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(<)'
2875 captures:
2876 1: entity.name.type.module.ts
2877 2: punctuation.accessor.ts
2878 3: punctuation.accessor.optional.ts
2879 4: meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
2880 push:
2881 - meta_content_scope: meta.type.parameters.ts
2882 - match: (>)
2883 captures:
2884 1: meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
2885 pop: true
2886 - include: type-arguments-body
2887 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(<)'
2888 captures:
2889 1: entity.name.type.ts
2890 2: meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
2891 push:
2892 - meta_content_scope: meta.type.parameters.ts
2893 - match: (>)
2894 captures:
2895 1: meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
2896 pop: true
2897 - include: type-arguments-body
2898 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))'
2899 captures:
2900 1: entity.name.type.module.ts
2901 2: punctuation.accessor.ts
2902 3: punctuation.accessor.optional.ts
2903 - match: "[_$[:alpha:]][_$[:alnum:]]*"
2904 scope: entity.name.type.ts
2905 type-object:
2906 - match: '\{'
2907 captures:
2908 0: punctuation.definition.block.ts
2909 push:
2910 - meta_scope: meta.object.type.ts
2911 - match: '\}'
2912 captures:
2913 0: punctuation.definition.block.ts
2914 pop: true
2915 - include: comment
2916 - include: method-declaration
2917 - include: indexer-declaration
2918 - include: indexer-mapped-type-declaration
2919 - include: field-declaration
2920 - include: type-annotation
2921 - match: \.\.\.
2922 captures:
2923 0: keyword.operator.spread.ts
2924 push:
2925 - match: '(?=\}|;|,|$)|(?<=\})'
2926 pop: true
2927 - include: type
2928 - include: punctuation-comma
2929 - include: punctuation-semicolon
2930 - include: type
2931 type-operators:
2932 - include: typeof-operator
2933 - match: '([&|])(?=\s*\{)'
2934 captures:
2935 0: keyword.operator.type.ts
2936 push:
2937 - match: '(?<=\})'
2938 pop: true
2939 - include: type-object
2940 - match: "[&|]"
2941 captures:
2942 0: keyword.operator.type.ts
2943 push:
2944 - match: (?=\S)
2945 pop: true
2946 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))keyof(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2947 scope: keyword.operator.expression.keyof.ts
2948 - match: (\?|\:)
2949 scope: keyword.operator.ternary.ts
2950 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))infer(?=\s+[_$[:alpha:]])'
2951 scope: keyword.operator.expression.infer.ts
2952 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))import(?=\s*\()'
2953 scope: keyword.operator.expression.import.ts
2954 type-parameters:
2955 - match: (<)
2956 captures:
2957 1: punctuation.definition.typeparameters.begin.ts
2958 push:
2959 - meta_scope: meta.type.parameters.ts
2960 - match: (>)
2961 captures:
2962 1: punctuation.definition.typeparameters.end.ts
2963 pop: true
2964 - include: comment
2965 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(extends)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2966 scope: storage.modifier.ts
2967 - include: type
2968 - include: punctuation-comma
2969 - match: (=)(?!>)
2970 scope: keyword.operator.assignment.ts
2971 type-paren-or-function-parameters:
2972 - match: \(
2973 captures:
2974 0: meta.brace.round.ts
2975 push:
2976 - meta_scope: meta.type.paren.cover.ts
2977 - match: \)
2978 captures:
2979 0: meta.brace.round.ts
2980 pop: true
2981 - match: |-
2982 (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s*(\??)(?=\s*(:\s*(
2983 (<) |
2984 ([(]\s*(
2985 ([)]) |
2986 (\.\.\.) |
2987 ([_$[:alnum:]]+\s*(
2988 ([:,?=])|
2989 ([)]\s*=>)
2990 ))
2991 ))
2992 )) |
2993 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
2994 (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))))
2995 captures:
2996 1: storage.modifier.ts
2997 2: keyword.operator.rest.ts
2998 3: entity.name.function.ts variable.language.this.ts
2999 4: entity.name.function.ts
3000 5: keyword.operator.optional.ts
3001 - match: '(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s*(\??)(?=:)'
3002 captures:
3003 1: storage.modifier.ts
3004 2: keyword.operator.rest.ts
3005 3: variable.parameter.ts variable.language.this.ts
3006 4: variable.parameter.ts
3007 5: keyword.operator.optional.ts
3008 - include: type-annotation
3009 - match: ","
3010 scope: punctuation.separator.parameter.ts
3011 - include: type
3012 type-predicate-operator:
3013 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(asserts)\s+)?(?!asserts)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s(is)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3014 captures:
3015 1: keyword.operator.type.asserts.ts
3016 2: variable.parameter.ts variable.language.this.ts
3017 3: variable.parameter.ts
3018 4: keyword.operator.expression.is.ts
3019 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(asserts)\s+(?!is)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3020 captures:
3021 1: keyword.operator.type.asserts.ts
3022 2: variable.parameter.ts variable.language.this.ts
3023 3: variable.parameter.ts
3024 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))asserts(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3025 scope: keyword.operator.type.asserts.ts
3026 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))is(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3027 scope: keyword.operator.expression.is.ts
3028 type-primitive:
3029 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(string|number|bigint|boolean|symbol|any|void|never|unknown)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3030 scope: support.type.primitive.ts
3031 type-tuple:
3032 - match: '\['
3033 captures:
3034 0: meta.brace.square.ts
3035 push:
3036 - meta_scope: meta.type.tuple.ts
3037 - match: '\]'
3038 captures:
3039 0: meta.brace.square.ts
3040 pop: true
3041 - include: type
3042 - include: punctuation-comma
3043 typeof-operator:
3044 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))typeof(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3045 scope: keyword.operator.expression.typeof.ts
3046 undefined-literal:
3047 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))undefined(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3048 scope: constant.language.undefined.ts
3049 var-expr:
3050 - match: '(?=(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))'
3051 push:
3052 - meta_scope: meta.var.expr.ts
3053 - match: '(?!(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|^\s*$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|((?<!^let|[^\._$[:alnum:]]let|^var|[^\._$[:alnum:]]var)(?=\s*$)))'
3054 pop: true
3055 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
3056 captures:
3057 1: keyword.control.export.ts
3058 2: storage.modifier.ts
3059 3: storage.type.ts
3060 push:
3061 - match: (?=\S)
3062 pop: true
3063 - include: destructuring-variable
3064 - include: var-single-variable
3065 - include: variable-initializer
3066 - include: comment
3067 - match: (,)\s*((?!\S)|(?=\/\/))
3068 captures:
3069 1: punctuation.separator.comma.ts
3070 push:
3071 - match: '(?<!,)(((?==|;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|^\s*$))|((?<=\S)(?=\s*$)))'
3072 pop: true
3073 - include: single-line-comment-consuming-line-ending
3074 - include: comment
3075 - include: destructuring-variable
3076 - include: var-single-variable
3077 - include: punctuation-comma
3078 - include: punctuation-comma
3079 - match: '(?=(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))'
3080 captures:
3081 1: keyword.control.export.ts
3082 2: storage.modifier.ts
3083 3: storage.type.ts
3084 push:
3085 - meta_scope: meta.var.expr.ts
3086 - match: '(?!(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|^\s*$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|((?<!^const|[^\._$[:alnum:]]const)(?=\s*$)))'
3087 pop: true
3088 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
3089 captures:
3090 1: keyword.control.export.ts
3091 2: storage.modifier.ts
3092 3: storage.type.ts
3093 push:
3094 - match: (?=\S)
3095 pop: true
3096 - include: destructuring-const
3097 - include: var-single-const
3098 - include: variable-initializer
3099 - include: comment
3100 - match: (,)\s*((?!\S)|(?=\/\/))
3101 captures:
3102 1: punctuation.separator.comma.ts
3103 push:
3104 - match: '(?<!,)(((?==|;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|^\s*$))|((?<=\S)(?=\s*$)))'
3105 pop: true
3106 - include: single-line-comment-consuming-line-ending
3107 - include: comment
3108 - include: destructuring-const
3109 - include: var-single-const
3110 - include: punctuation-comma
3111 - include: punctuation-comma
3112 var-single-const:
3113 - match: |-
3114 (?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\s*
3115 # function assignment |
3116 (=\s*(
3117 ((async\s+)?(
3118 (function\s*[(<*]) |
3119 (function\s+) |
3120 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3121 )) |
3122 ((async\s*)?(
3123 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3124 # sure shot arrow functions even if => is on new line
3126 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3127 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3129 ([)]\s*:) | # ():
3130 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3132 ) |
3134 # arrow function possible to detect only with => on same line
3136 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3137 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3138 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3139 \s*=> # arrow operator
3141 ))
3142 )) |
3143 # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
3144 (:\s*(
3145 (<) |
3146 ([(]\s*(
3147 ([)]) |
3148 (\.\.\.) |
3149 ([_$[:alnum:]]+\s*(
3150 ([:,?=])|
3151 ([)]\s*=>)
3152 ))
3153 ))
3154 )) |
3155 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
3156 (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
3157 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
3158 ((async\s+)?(
3159 (function\s*[(<*]) |
3160 (function\s+) |
3161 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3162 )) |
3163 ((async\s*)?(
3164 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3165 # sure shot arrow functions even if => is on new line
3167 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3168 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3170 ([)]\s*:) | # ():
3171 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3173 ) |
3175 # arrow function possible to detect only with => on same line
3177 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3178 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3179 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3180 \s*=> # arrow operator
3182 ))
3183 )))
3184 captures:
3185 1: meta.definition.variable.ts variable.other.constant.ts entity.name.function.ts
3186 push:
3187 - meta_scope: meta.var-single-variable.expr.ts
3188 - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3189 pop: true
3190 - include: var-single-variable-type-annotation
3191 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
3192 captures:
3193 1: meta.definition.variable.ts variable.other.constant.ts
3194 push:
3195 - meta_scope: meta.var-single-variable.expr.ts
3196 - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3197 pop: true
3198 - include: var-single-variable-type-annotation
3199 var-single-variable:
3200 - match: |-
3201 (?x)([_$[:alpha:]][_$[:alnum:]]*)(\!)?(?=\s*
3202 # function assignment |
3203 (=\s*(
3204 ((async\s+)?(
3205 (function\s*[(<*]) |
3206 (function\s+) |
3207 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3208 )) |
3209 ((async\s*)?(
3210 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3211 # sure shot arrow functions even if => is on new line
3213 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3214 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3216 ([)]\s*:) | # ():
3217 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3219 ) |
3221 # arrow function possible to detect only with => on same line
3223 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3224 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3225 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3226 \s*=> # arrow operator
3228 ))
3229 )) |
3230 # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
3231 (:\s*(
3232 (<) |
3233 ([(]\s*(
3234 ([)]) |
3235 (\.\.\.) |
3236 ([_$[:alnum:]]+\s*(
3237 ([:,?=])|
3238 ([)]\s*=>)
3239 ))
3240 ))
3241 )) |
3242 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
3243 (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
3244 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
3245 ((async\s+)?(
3246 (function\s*[(<*]) |
3247 (function\s+) |
3248 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3249 )) |
3250 ((async\s*)?(
3251 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3252 # sure shot arrow functions even if => is on new line
3254 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3255 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3257 ([)]\s*:) | # ():
3258 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3260 ) |
3262 # arrow function possible to detect only with => on same line
3264 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3265 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3266 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3267 \s*=> # arrow operator
3269 ))
3270 )))
3271 captures:
3272 1: meta.definition.variable.ts entity.name.function.ts
3273 2: keyword.operator.definiteassignment.ts
3274 push:
3275 - meta_scope: meta.var-single-variable.expr.ts
3276 - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3277 pop: true
3278 - include: var-single-variable-type-annotation
3279 - match: '([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])(\!)?'
3280 captures:
3281 1: meta.definition.variable.ts variable.other.constant.ts
3282 2: keyword.operator.definiteassignment.ts
3283 push:
3284 - meta_scope: meta.var-single-variable.expr.ts
3285 - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3286 pop: true
3287 - include: var-single-variable-type-annotation
3288 - match: '([_$[:alpha:]][_$[:alnum:]]*)(\!)?'
3289 captures:
3290 1: meta.definition.variable.ts variable.other.readwrite.ts
3291 2: keyword.operator.definiteassignment.ts
3292 push:
3293 - meta_scope: meta.var-single-variable.expr.ts
3294 - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3295 pop: true
3296 - include: var-single-variable-type-annotation
3297 var-single-variable-type-annotation:
3298 - include: type-annotation
3299 - include: string
3300 - include: comment
3301 variable-initializer:
3302 - match: (?<!=|!)(=)(?!=)(?=\s*\S)(?!\s*.*=>\s*$)
3303 captures:
3304 1: keyword.operator.assignment.ts
3305 push:
3306 - match: '(?=$|^|[,);}\]]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3307 pop: true
3308 - include: expression
3309 - match: (?<!=|!)(=)(?!=)
3310 captures:
3311 1: keyword.operator.assignment.ts
3312 push:
3313 - match: '(?=[,);}\]]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))|(?=^\s*$)|(?<=\S)(?<!=)(?=\s*$)'
3314 pop: true
3315 - include: expression