on 47a3721 help sign in
bat/assets/syntaxes/02_Extra/TypeScript.sublime-syntax
3340 lines 186 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|declare)(?![_$[: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+(type))?(?:(?:\s*(=))|(?:\s+(default)(?=\s+)))'
761 captures:
762 1: keyword.control.export.ts
763 2: keyword.control.type.ts
764 3: keyword.operator.assignment.ts
765 4: keyword.control.default.ts
766 push:
767 - meta_scope: meta.export.default.ts
768 - match: (?=$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))
769 pop: true
770 - include: interface-declaration
771 - include: expression
772 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(export)(?:\s+(type))?\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)))'
773 captures:
774 1: keyword.control.export.ts
775 2: keyword.control.type.ts
776 push:
777 - meta_scope: meta.export.ts
778 - match: (?=$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))
779 pop: true
780 - include: import-export-declaration
781 expression:
782 - include: expressionWithoutIdentifiers
783 - include: identifiers
784 - include: expressionPunctuations
785 expression-inside-possibly-arrow-parens:
786 - include: expressionWithoutIdentifiers
787 - include: comment
788 - include: string
789 - include: decorator
790 - include: destructuring-parameter
791 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|protected|private|readonly)\s+(?=(public|protected|private|readonly)\s+)'
792 captures:
793 1: storage.modifier.ts
794 - match: |-
795 (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*
796 # function assignment |
797 (=\s*(
798 ((async\s+)?(
799 (function\s*[(<*]) |
800 (function\s+) |
801 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
802 )) |
803 ((async\s*)?(
804 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
805 # sure shot arrow functions even if => is on new line
806 (
807 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
808 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
809 (
810 ([)]\s*:) | # ():
811 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
812 )
813 ) |
815 # arrow function possible to detect only with => on same line
816 (
817 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
818 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
819 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
820 \s*=> # arrow operator
821 )
822 ))
823 )) |
824 # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
825 (:\s*(
826 (<) |
827 ([(]\s*(
828 ([)]) |
829 (\.\.\.) |
830 ([_$[:alnum:]]+\s*(
831 ([:,?=])|
832 ([)]\s*=>)
833 ))
834 ))
835 )) |
836 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
837 (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
838 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
839 ((async\s+)?(
840 (function\s*[(<*]) |
841 (function\s+) |
842 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
843 )) |
844 ((async\s*)?(
845 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
846 # sure shot arrow functions even if => is on new line
847 (
848 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
849 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
850 (
851 ([)]\s*:) | # ():
852 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
853 )
854 ) |
856 # arrow function possible to detect only with => on same line
857 (
858 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
859 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
860 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
861 \s*=> # arrow operator
862 )
863 ))
864 )))
865 captures:
866 1: storage.modifier.ts
867 2: keyword.operator.rest.ts
868 3: entity.name.function.ts variable.language.this.ts
869 4: entity.name.function.ts
870 5: keyword.operator.optional.ts
871 - match: '(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*[:,]|$)'
872 captures:
873 1: storage.modifier.ts
874 2: keyword.operator.rest.ts
875 3: variable.parameter.ts variable.language.this.ts
876 4: variable.parameter.ts
877 5: keyword.operator.optional.ts
878 - include: type-annotation
879 - include: variable-initializer
880 - match: ","
881 scope: punctuation.separator.parameter.ts
882 - include: identifiers
883 - include: expressionPunctuations
884 expression-operators:
885 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(await)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
886 scope: keyword.control.flow.ts
887 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(yield)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))(?=\s*\/\*([^\*]|(\*[^\/]))*\*\/\s*\*)'
888 captures:
889 1: keyword.control.flow.ts
890 push:
891 - match: \*
892 captures:
893 0: keyword.generator.asterisk.ts
894 pop: true
895 - include: comment
896 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(yield)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))(?:\s*(\*))?'
897 captures:
898 1: keyword.control.flow.ts
899 2: keyword.generator.asterisk.ts
900 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))delete(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
901 scope: keyword.operator.expression.delete.ts
902 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))in(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))(?!\()'
903 scope: keyword.operator.expression.in.ts
904 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))of(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))(?!\()'
905 scope: keyword.operator.expression.of.ts
906 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))instanceof(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
907 scope: keyword.operator.expression.instanceof.ts
908 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))new(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
909 scope: keyword.operator.new.ts
910 - include: typeof-operator
911 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))void(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
912 scope: keyword.operator.expression.void.ts
913 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+(const)(?=\s*($|[;,:})\]]))'
914 captures:
915 1: keyword.control.as.ts
916 2: storage.modifier.ts
917 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+'
918 captures:
919 1: keyword.control.as.ts
920 push:
921 - match: '(?=$|^|[;,:})\]]|\|\||\&\&|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+)|(\s+\<))'
922 pop: true
923 - include: type
924 - match: \.\.\.
925 scope: keyword.operator.spread.ts
926 - match: \*=|(?<!\()/=|%=|\+=|\-=
927 scope: keyword.operator.assignment.compound.ts
928 - match: \&=|\^=|<<=|>>=|>>>=|\|=
929 scope: keyword.operator.assignment.compound.bitwise.ts
930 - match: "<<|>>>|>>"
931 scope: keyword.operator.bitwise.shift.ts
932 - match: "===|!==|==|!="
933 scope: keyword.operator.comparison.ts
934 - match: <=|>=|<>|<|>
935 scope: keyword.operator.relational.ts
936 - match: '(\!)\s*(/)(?![/*])'
937 captures:
938 1: keyword.operator.logical.ts
939 2: keyword.operator.arithmetic.ts
940 - match: \!|&&|\|\||\?\?
941 scope: keyword.operator.logical.ts
942 - match: \&|~|\^|\|
943 scope: keyword.operator.bitwise.ts
944 - match: \=
945 scope: keyword.operator.assignment.ts
946 - match: "--"
947 scope: keyword.operator.decrement.ts
948 - match: \+\+
949 scope: keyword.operator.increment.ts
950 - match: '%|\*|/|-|\+'
951 scope: keyword.operator.arithmetic.ts
952 - match: '(?<=[_$[:alnum:])\]])\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)+(/)(?![/*]))'
953 push:
954 - match: '(/)(?!\*([^\*]|(\*[^\/]))*\*\/)'
955 captures:
956 1: keyword.operator.arithmetic.ts
957 pop: true
958 - include: comment
959 - match: '(?<=[_$[:alnum:])\]])\s*(/)(?![/*])'
960 captures:
961 1: keyword.operator.arithmetic.ts
962 expressionPunctuations:
963 - include: punctuation-comma
964 - include: punctuation-accessor
965 expressionWithoutIdentifiers:
966 - include: string
967 - include: regex
968 - include: comment
969 - include: function-expression
970 - include: class-expression
971 - include: arrow-function
972 - include: paren-expression-possibly-arrow
973 - include: cast
974 - include: ternary-expression
975 - include: new-expr
976 - include: instanceof-expr
977 - include: object-literal
978 - include: expression-operators
979 - include: function-call
980 - include: literal
981 - include: support-objects
982 - include: paren-expression
983 field-declaration:
984 - match: |-
985 (?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(?!\$))|((?<!\$)(?:
986 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
987 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
988 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
989 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
990 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
991 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
992 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
993 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
994 )(?!\$))|(\#?[_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(?:(?:(\?)|(\!))\s*)?(=|:|;|,|\}|$))
995 captures:
996 1: storage.modifier.ts
997 push:
998 - meta_scope: meta.field.declaration.ts
999 - match: |-
1000 (?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(?!\$))|((?<!\$)(?:
1001 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1002 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1003 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1004 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1005 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1006 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1007 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1008 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1009 )(?!\$))|(\#?[_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(?:(?:(\?)|(\!))\s*)?(=|:|;|,|$))))|(?<=\})
1010 pop: true
1011 - include: variable-initializer
1012 - include: type-annotation
1013 - include: string
1014 - include: array-literal
1015 - include: numeric-literal
1016 - include: comment
1017 - match: |-
1018 (?x)(\#?[_$[:alpha:]][_$[:alnum:]]*)(?:(\?)|(\!))?(?=\s*\s*
1019 # function assignment |
1020 (=\s*(
1021 ((async\s+)?(
1022 (function\s*[(<*]) |
1023 (function\s+) |
1024 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1025 )) |
1026 ((async\s*)?(
1027 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1028 # sure shot arrow functions even if => is on new line
1030 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1031 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1033 ([)]\s*:) | # ():
1034 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1036 ) |
1038 # arrow function possible to detect only with => on same line
1040 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1041 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1042 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1043 \s*=> # arrow operator
1045 ))
1046 )) |
1047 # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
1048 (:\s*(
1049 (<) |
1050 ([(]\s*(
1051 ([)]) |
1052 (\.\.\.) |
1053 ([_$[:alnum:]]+\s*(
1054 ([:,?=])|
1055 ([)]\s*=>)
1056 ))
1057 ))
1058 )) |
1059 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
1060 (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
1061 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
1062 ((async\s+)?(
1063 (function\s*[(<*]) |
1064 (function\s+) |
1065 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1066 )) |
1067 ((async\s*)?(
1068 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1069 # sure shot arrow functions even if => is on new line
1071 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1072 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1074 ([)]\s*:) | # ():
1075 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1077 ) |
1079 # arrow function possible to detect only with => on same line
1081 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1082 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1083 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1084 \s*=> # arrow operator
1086 ))
1087 )))
1088 captures:
1089 1: meta.definition.property.ts entity.name.function.ts
1090 2: keyword.operator.optional.ts
1091 3: keyword.operator.definiteassignment.ts
1092 - match: '\#?[_$[:alpha:]][_$[:alnum:]]*'
1093 scope: meta.definition.property.ts variable.object.property.ts
1094 - match: \?
1095 scope: keyword.operator.optional.ts
1096 - match: \!
1097 scope: keyword.operator.definiteassignment.ts
1098 for-loop:
1099 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))for(?=((\s+|(\s*\/\*([^\*]|(\*[^\/]))*\*\/\s*))await)?\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)?(\())'
1100 captures:
1101 0: keyword.control.loop.ts
1102 push:
1103 - match: (?<=\))
1104 pop: true
1105 - include: comment
1106 - match: await
1107 scope: keyword.control.loop.ts
1108 - match: \(
1109 captures:
1110 0: meta.brace.round.ts
1111 push:
1112 - match: \)
1113 captures:
1114 0: meta.brace.round.ts
1115 pop: true
1116 - include: var-expr
1117 - include: expression
1118 - include: punctuation-semicolon
1119 function-body:
1120 - include: comment
1121 - include: type-parameters
1122 - include: function-parameters
1123 - include: return-type
1124 - include: decl-block
1125 - match: \*
1126 scope: keyword.generator.asterisk.ts
1127 function-call:
1128 - match: '(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))\s*(?:(\?\.\s*)|(\!))?(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\()'
1129 push:
1130 - match: '(?<=\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))\s*(?:(\?\.\s*)|(\!))?(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\()'
1131 pop: true
1132 - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))'
1133 push:
1134 - meta_scope: meta.function-call.ts
1135 - match: '(?=\s*(?:(\?\.\s*)|(\!))?(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\()'
1136 pop: true
1137 - include: support-function-call-identifiers
1138 - match: '(\#?[_$[:alpha:]][_$[:alnum:]]*)'
1139 scope: entity.name.function.ts
1140 - include: comment
1141 - match: \?\.
1142 scope: meta.function-call.ts punctuation.accessor.optional.ts
1143 - match: \!
1144 scope: meta.function-call.ts keyword.operator.definiteassignment.ts
1145 - include: type-arguments
1146 - include: paren-expression
1147 function-declaration:
1148 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*'
1149 captures:
1150 1: keyword.control.export.ts
1151 2: storage.modifier.ts
1152 3: storage.modifier.async.ts
1153 4: storage.type.function.ts
1154 5: keyword.generator.asterisk.ts
1155 6: meta.definition.function.ts entity.name.function.ts
1156 push:
1157 - meta_scope: meta.function.ts
1158 - match: '(?=;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|(?<=\})'
1159 pop: true
1160 - include: function-name
1161 - include: function-body
1162 function-expression:
1163 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*'
1164 captures:
1165 1: storage.modifier.async.ts
1166 2: storage.type.function.ts
1167 3: keyword.generator.asterisk.ts
1168 4: meta.definition.function.ts entity.name.function.ts
1169 push:
1170 - meta_scope: meta.function.expression.ts
1171 - match: '(?=;)|(?<=\})'
1172 pop: true
1173 - include: function-name
1174 - include: single-line-comment-consuming-line-ending
1175 - include: function-body
1176 function-name:
1177 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1178 scope: meta.definition.function.ts entity.name.function.ts
1179 function-parameters:
1180 - match: \(
1181 captures:
1182 0: punctuation.definition.parameters.begin.ts
1183 push:
1184 - meta_scope: meta.parameters.ts
1185 - match: \)
1186 captures:
1187 0: punctuation.definition.parameters.end.ts
1188 pop: true
1189 - include: function-parameters-body
1190 function-parameters-body:
1191 - include: comment
1192 - include: string
1193 - include: decorator
1194 - include: destructuring-parameter
1195 - include: parameter-name
1196 - include: parameter-type-annotation
1197 - include: variable-initializer
1198 - match: ","
1199 scope: punctuation.separator.parameter.ts
1200 identifiers:
1201 - include: object-identifiers
1202 - match: |-
1203 (?x)(?:(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\s*=\s*(
1204 ((async\s+)?(
1205 (function\s*[(<*]) |
1206 (function\s+) |
1207 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1208 )) |
1209 ((async\s*)?(
1210 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1211 # sure shot arrow functions even if => is on new line
1213 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1214 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1216 ([)]\s*:) | # ():
1217 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1219 ) |
1221 # arrow function possible to detect only with => on same line
1223 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1224 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1225 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1226 \s*=> # arrow operator
1228 ))
1229 ))
1230 captures:
1231 1: punctuation.accessor.ts
1232 2: punctuation.accessor.optional.ts
1233 3: entity.name.function.ts
1234 - match: '(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])'
1235 captures:
1236 1: punctuation.accessor.ts
1237 2: punctuation.accessor.optional.ts
1238 3: variable.other.constant.property.ts
1239 - match: '(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(\#?[_$[:alpha:]][_$[:alnum:]]*)'
1240 captures:
1241 1: punctuation.accessor.ts
1242 2: punctuation.accessor.optional.ts
1243 3: variable.other.property.ts
1244 - match: "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])"
1245 scope: variable.other.constant.ts
1246 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1247 scope: variable.other.readwrite.ts
1248 if-statement:
1249 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?=\bif\s*(\(([^\(\)]|(\([^\(\)]*\)))*\))\s*(?!\{))'
1250 push:
1251 - match: '(?=;|$|\})'
1252 pop: true
1253 - include: comment
1254 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(if)\s*(\()'
1255 captures:
1256 1: keyword.control.conditional.ts
1257 2: meta.brace.round.ts
1258 push:
1259 - match: \)
1260 captures:
1261 0: meta.brace.round.ts
1262 pop: true
1263 - include: expression
1264 - match: '(?<=\))\s*\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/([gimsuy]+|(?![\/\*])|(?=\/\*))(?!\s*[a-zA-Z0-9_$]))'
1265 captures:
1266 0: punctuation.definition.string.begin.ts
1267 push:
1268 - meta_scope: string.regexp.ts
1269 - match: "(/)([gimsuy]*)"
1270 captures:
1271 1: punctuation.definition.string.end.ts
1272 2: keyword.other.ts
1273 pop: true
1274 - include: regexp
1275 - include: statements
1276 import-declaration:
1277 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)(?:\s+(type)(?!\s+from))?(?!\s*[:\(])(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1278 captures:
1279 1: keyword.control.export.ts
1280 2: storage.modifier.ts
1281 3: keyword.control.import.ts
1282 4: keyword.control.type.ts
1283 push:
1284 - meta_scope: meta.import.ts
1285 - match: '(?<!^import|[^\._$[:alnum:]]import)(?=;|$|^)'
1286 pop: true
1287 - include: single-line-comment-consuming-line-ending
1288 - include: comment
1289 - include: string
1290 - match: '(?<=^import|[^\._$[:alnum:]]import)(?!\s*["''])'
1291 push:
1292 - match: \bfrom\b
1293 captures:
1294 0: keyword.control.from.ts
1295 pop: true
1296 - include: import-export-declaration
1297 - include: import-export-declaration
1298 import-equals-declaration:
1299 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)(?:\s+(type))?\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(require)\s*(\()'
1300 captures:
1301 1: keyword.control.export.ts
1302 2: storage.modifier.ts
1303 3: keyword.control.import.ts
1304 4: keyword.control.type.ts
1305 5: variable.other.readwrite.alias.ts
1306 6: keyword.operator.assignment.ts
1307 7: keyword.control.require.ts
1308 8: meta.brace.round.ts
1309 push:
1310 - meta_scope: meta.import-equals.external.ts
1311 - match: \)
1312 captures:
1313 0: meta.brace.round.ts
1314 pop: true
1315 - include: comment
1316 - include: string
1317 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)(?:\s+(type))?\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(?!require\b)'
1318 captures:
1319 1: keyword.control.export.ts
1320 2: storage.modifier.ts
1321 3: keyword.control.import.ts
1322 4: keyword.control.type.ts
1323 5: variable.other.readwrite.alias.ts
1324 6: keyword.operator.assignment.ts
1325 push:
1326 - meta_scope: meta.import-equals.internal.ts
1327 - match: (?=;|$|^)
1328 pop: true
1329 - include: single-line-comment-consuming-line-ending
1330 - include: comment
1331 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))'
1332 captures:
1333 1: entity.name.type.module.ts
1334 2: punctuation.accessor.ts
1335 3: punctuation.accessor.optional.ts
1336 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
1337 scope: variable.other.readwrite.ts
1338 import-export-block:
1339 - match: '\{'
1340 captures:
1341 0: punctuation.definition.block.ts
1342 push:
1343 - meta_scope: meta.block.ts
1344 - match: '\}'
1345 captures:
1346 0: punctuation.definition.block.ts
1347 pop: true
1348 - include: import-export-clause
1349 import-export-clause:
1350 - include: comment
1351 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bdefault)|(\*)|(\b[_$[:alpha:]][_$[:alnum:]]*))\s+(as)\s+(?:(default(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|([_$[:alpha:]][_$[:alnum:]]*))'
1352 captures:
1353 1: keyword.control.default.ts
1354 2: constant.language.import-export-all.ts
1355 3: variable.other.readwrite.ts
1356 4: keyword.control.as.ts
1357 5: keyword.control.default.ts
1358 6: variable.other.readwrite.alias.ts
1359 - include: punctuation-comma
1360 - match: \*
1361 scope: constant.language.import-export-all.ts
1362 - match: \b(default)\b
1363 scope: keyword.control.default.ts
1364 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
1365 scope: variable.other.readwrite.alias.ts
1366 import-export-declaration:
1367 - include: comment
1368 - include: string
1369 - include: import-export-block
1370 - match: \bfrom\b
1371 scope: keyword.control.from.ts
1372 - include: import-export-clause
1373 indexer-declaration:
1374 - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(readonly)\s*)?\s*(\[)\s*([_$[:alpha:]][_$[:alnum:]]*)\s*(?=:)'
1375 captures:
1376 1: storage.modifier.ts
1377 2: meta.brace.square.ts
1378 3: variable.parameter.ts
1379 push:
1380 - meta_scope: meta.indexer.declaration.ts
1381 - match: '(\])\s*(\?\s*)?|$'
1382 captures:
1383 1: meta.brace.square.ts
1384 2: keyword.operator.optional.ts
1385 pop: true
1386 - include: type-annotation
1387 indexer-mapped-type-declaration:
1388 - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))([+-])?(readonly)\s*)?\s*(\[)\s*([_$[:alpha:]][_$[:alnum:]]*)\s+(in)\s+'
1389 captures:
1390 1: keyword.operator.type.modifier.ts
1391 2: storage.modifier.ts
1392 3: meta.brace.square.ts
1393 4: entity.name.type.ts
1394 5: keyword.operator.expression.in.ts
1395 push:
1396 - meta_scope: meta.indexer.mappedtype.declaration.ts
1397 - match: '(\])([+-])?\s*(\?\s*)?|$'
1398 captures:
1399 1: meta.brace.square.ts
1400 2: keyword.operator.type.modifier.ts
1401 3: keyword.operator.optional.ts
1402 pop: true
1403 - include: type
1404 inline-tags:
1405 - match: '(\[)[^\]]+(\])(?={@(?:link|linkcode|linkplain|tutorial))'
1406 scope: constant.other.description.jsdoc
1407 captures:
1408 1: punctuation.definition.bracket.square.begin.jsdoc
1409 2: punctuation.definition.bracket.square.end.jsdoc
1410 - match: '({)((@)(?:link(?:code|plain)?|tutorial))\s*'
1411 captures:
1412 1: punctuation.definition.bracket.curly.begin.jsdoc
1413 2: storage.type.class.jsdoc
1414 3: punctuation.definition.inline.tag.jsdoc
1415 push:
1416 - meta_scope: entity.name.type.instance.jsdoc
1417 - match: '}|(?=\*/)'
1418 captures:
1419 0: punctuation.definition.bracket.curly.end.jsdoc
1420 pop: true
1421 - match: '\G((?=https?://)(?:[^|}\s*]|\*[/])+)(\|)?'
1422 captures:
1423 1: variable.other.link.underline.jsdoc
1424 2: punctuation.separator.pipe.jsdoc
1425 - match: '\G((?:[^{}@\s|*]|\*[^/])+)(\|)?'
1426 captures:
1427 1: variable.other.description.jsdoc
1428 2: punctuation.separator.pipe.jsdoc
1429 instanceof-expr:
1430 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(instanceof)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1431 captures:
1432 1: keyword.operator.expression.instanceof.ts
1433 push:
1434 - match: '(?<=\))|(?=[;),}\]:?]|\|\||\&\&|$|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))function((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))'
1435 pop: true
1436 - include: type
1437 interface-declaration:
1438 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(?:(abstract)\s+)?\b(interface)\b(?=\s+|/[/*])'
1439 captures:
1440 1: keyword.control.export.ts
1441 2: storage.modifier.ts
1442 3: storage.modifier.ts
1443 4: storage.type.interface.ts
1444 push:
1445 - meta_scope: meta.interface.ts
1446 - match: '(?<=\})'
1447 pop: true
1448 - include: comment
1449 - include: class-or-interface-heritage
1450 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1451 captures:
1452 0: entity.name.type.interface.ts
1453 - include: type-parameters
1454 - include: class-or-interface-body
1455 jsdoctype:
1456 - match: '\G{(?:[^}*]|\*[^/}])+$'
1457 scope: invalid.illegal.type.jsdoc
1458 - match: '\G({)'
1459 captures:
1460 0: entity.name.type.instance.jsdoc
1461 1: punctuation.definition.bracket.curly.begin.jsdoc
1462 push:
1463 - meta_content_scope: entity.name.type.instance.jsdoc
1464 - match: '((}))\s*|(?=\*/)'
1465 captures:
1466 1: entity.name.type.instance.jsdoc
1467 2: punctuation.definition.bracket.curly.end.jsdoc
1468 pop: true
1469 - include: brackets
1470 label:
1471 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(:)(?=\s*\{)'
1472 captures:
1473 1: entity.name.label.ts
1474 2: punctuation.separator.label.ts
1475 push:
1476 - match: '(?<=\})'
1477 pop: true
1478 - include: decl-block
1479 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(:)'
1480 captures:
1481 1: entity.name.label.ts
1482 2: punctuation.separator.label.ts
1483 literal:
1484 - include: numeric-literal
1485 - include: boolean-literal
1486 - include: null-literal
1487 - include: undefined-literal
1488 - include: numericConstant-literal
1489 - include: array-literal
1490 - include: this-literal
1491 - include: super-literal
1492 method-declaration:
1493 - match: '(?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?\s*\b(constructor)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1494 captures:
1495 1: storage.modifier.ts
1496 2: storage.modifier.ts
1497 3: storage.modifier.async.ts
1498 4: storage.type.ts
1499 push:
1500 - meta_scope: meta.method.declaration.ts
1501 - match: '(?=\}|;|,|$)|(?<=\})'
1502 pop: true
1503 - include: method-declaration-name
1504 - include: function-body
1505 - 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*))?[\(])'
1506 captures:
1507 1: storage.modifier.ts
1508 2: storage.modifier.ts
1509 3: storage.modifier.async.ts
1510 4: keyword.operator.new.ts
1511 5: keyword.generator.asterisk.ts
1512 push:
1513 - meta_scope: meta.method.declaration.ts
1514 - match: '(?=\}|;|,|$)|(?<=\})'
1515 pop: true
1516 - include: method-declaration-name
1517 - include: function-body
1518 - match: |-
1519 (?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(?!\$))|((?<!\$)(?:
1520 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1521 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1522 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1523 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1524 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1525 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1526 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1527 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1528 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1529 captures:
1530 1: storage.modifier.ts
1531 2: storage.modifier.ts
1532 3: storage.modifier.async.ts
1533 4: storage.type.property.ts
1534 5: keyword.generator.asterisk.ts
1535 push:
1536 - meta_scope: meta.method.declaration.ts
1537 - match: '(?=\}|;|,|$)|(?<=\})'
1538 pop: true
1539 - include: method-declaration-name
1540 - include: function-body
1541 method-declaration-name:
1542 - match: |-
1543 (?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(?!\$))|((?<!\$)(?:
1544 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1545 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1546 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1547 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1548 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1549 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1550 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1551 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1552 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??)\s*[\(\<])
1553 push:
1554 - match: (?=\(|\<)
1555 pop: true
1556 - include: string
1557 - include: array-literal
1558 - include: numeric-literal
1559 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1560 scope: meta.definition.method.ts entity.name.function.ts
1561 - match: \?
1562 scope: keyword.operator.optional.ts
1563 namespace-declaration:
1564 - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(namespace|module)\s+(?=[_$[:alpha:]"''`]))'
1565 captures:
1566 1: keyword.control.export.ts
1567 2: storage.modifier.ts
1568 3: storage.type.namespace.ts
1569 push:
1570 - meta_scope: meta.namespace.declaration.ts
1571 - match: '(?<=\})|(?=;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
1572 pop: true
1573 - include: comment
1574 - include: string
1575 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
1576 scope: entity.name.type.module.ts
1577 - include: punctuation-accessor
1578 - include: decl-block
1579 new-expr:
1580 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1581 captures:
1582 1: keyword.operator.new.ts
1583 push:
1584 - meta_scope: new.expr.ts
1585 - match: '(?<=\))|(?=[;),}\]:\-\+]|\|\||\&\&|$|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))new(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))function((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))'
1586 pop: true
1587 - include: paren-expression
1588 - include: class-declaration
1589 - include: type
1590 null-literal:
1591 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))null(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1592 scope: constant.language.null.ts
1593 numeric-literal:
1594 - match: '\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$)'
1595 scope: constant.numeric.hex.ts
1596 captures:
1597 1: storage.type.numeric.bigint.ts
1598 - match: '\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$)'
1599 scope: constant.numeric.binary.ts
1600 captures:
1601 1: storage.type.numeric.bigint.ts
1602 - match: '\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$)'
1603 scope: constant.numeric.octal.ts
1604 captures:
1605 1: storage.type.numeric.bigint.ts
1606 - match: |-
1607 (?x)
1608 (?<!\$)(?:
1609 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1610 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1611 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1612 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1613 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1614 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1615 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1616 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1617 )(?!\$)
1618 captures:
1619 0: constant.numeric.decimal.ts
1620 1: meta.delimiter.decimal.period.ts
1621 2: storage.type.numeric.bigint.ts
1622 3: meta.delimiter.decimal.period.ts
1623 4: storage.type.numeric.bigint.ts
1624 5: meta.delimiter.decimal.period.ts
1625 6: storage.type.numeric.bigint.ts
1626 7: storage.type.numeric.bigint.ts
1627 8: meta.delimiter.decimal.period.ts
1628 9: storage.type.numeric.bigint.ts
1629 10: meta.delimiter.decimal.period.ts
1630 11: storage.type.numeric.bigint.ts
1631 12: meta.delimiter.decimal.period.ts
1632 13: storage.type.numeric.bigint.ts
1633 14: storage.type.numeric.bigint.ts
1634 numericConstant-literal:
1635 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))NaN(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1636 scope: constant.language.nan.ts
1637 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Infinity(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1638 scope: constant.language.infinity.ts
1639 object-binding-element:
1640 - include: comment
1641 - match: |-
1642 (?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(?!\$))|((?<!\$)(?:
1643 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1644 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1645 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1646 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1647 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1648 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1649 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1650 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1651 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1652 push:
1653 - match: '(?=,|\})'
1654 pop: true
1655 - include: object-binding-element-propertyName
1656 - include: binding-element
1657 - include: object-binding-pattern
1658 - include: destructuring-variable-rest
1659 - include: variable-initializer
1660 - include: punctuation-comma
1661 object-binding-element-const:
1662 - include: comment
1663 - match: |-
1664 (?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(?!\$))|((?<!\$)(?:
1665 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1666 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1667 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1668 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1669 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1670 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1671 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1672 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1673 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1674 push:
1675 - match: '(?=,|\})'
1676 pop: true
1677 - include: object-binding-element-propertyName
1678 - include: binding-element-const
1679 - include: object-binding-pattern-const
1680 - include: destructuring-variable-rest-const
1681 - include: variable-initializer
1682 - include: punctuation-comma
1683 object-binding-element-propertyName:
1684 - match: |-
1685 (?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(?!\$))|((?<!\$)(?:
1686 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1687 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1688 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1689 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1690 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1691 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1692 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1693 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1694 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1695 push:
1696 - match: (:)
1697 captures:
1698 0: punctuation.destructuring.ts
1699 pop: true
1700 - include: string
1701 - include: array-literal
1702 - include: numeric-literal
1703 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
1704 scope: variable.object.property.ts
1705 object-binding-pattern:
1706 - match: '(?:(\.\.\.)\s*)?(\{)'
1707 captures:
1708 1: keyword.operator.rest.ts
1709 2: punctuation.definition.binding-pattern.object.ts
1710 push:
1711 - match: '\}'
1712 captures:
1713 0: punctuation.definition.binding-pattern.object.ts
1714 pop: true
1715 - include: object-binding-element
1716 object-binding-pattern-const:
1717 - match: '(?:(\.\.\.)\s*)?(\{)'
1718 captures:
1719 1: keyword.operator.rest.ts
1720 2: punctuation.definition.binding-pattern.object.ts
1721 push:
1722 - match: '\}'
1723 captures:
1724 0: punctuation.definition.binding-pattern.object.ts
1725 pop: true
1726 - include: object-binding-element-const
1727 object-identifiers:
1728 - match: '([_$[:alpha:]][_$[:alnum:]]*)(?=\s*\??\.\s*prototype\b(?!\$))'
1729 scope: support.class.ts
1730 - match: |-
1731 (?x)(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(?:
1732 (\#?[[:upper:]][_$[:digit:][:upper:]]*) |
1733 (\#?[_$[:alpha:]][_$[:alnum:]]*)
1734 )(?=\s*\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*)
1735 captures:
1736 1: punctuation.accessor.ts
1737 2: punctuation.accessor.optional.ts
1738 3: variable.other.constant.object.property.ts
1739 4: variable.other.object.property.ts
1740 - match: |-
1741 (?x)(?:
1742 ([[:upper:]][_$[:digit:][:upper:]]*) |
1743 ([_$[:alpha:]][_$[:alnum:]]*)
1744 )(?=\s*\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*)
1745 captures:
1746 1: variable.other.constant.object.ts
1747 2: variable.other.object.ts
1748 object-literal:
1749 - match: '\{'
1750 captures:
1751 0: punctuation.definition.block.ts
1752 push:
1753 - meta_scope: meta.objectliteral.ts
1754 - match: '\}'
1755 captures:
1756 0: punctuation.definition.block.ts
1757 pop: true
1758 - include: object-member
1759 object-literal-method-declaration:
1760 - match: |-
1761 (?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(?!\$))|((?<!\$)(?:
1762 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1763 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1764 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1765 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1766 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1767 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1768 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1769 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1770 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1771 captures:
1772 1: storage.modifier.async.ts
1773 2: storage.type.property.ts
1774 3: keyword.generator.asterisk.ts
1775 push:
1776 - meta_scope: meta.method.declaration.ts
1777 - match: '(?=\}|;|,)|(?<=\})'
1778 pop: true
1779 - include: method-declaration-name
1780 - include: function-body
1781 - match: |-
1782 (?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(?!\$))|((?<!\$)(?:
1783 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1784 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1785 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1786 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1787 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1788 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1789 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1790 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1791 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1792 captures:
1793 1: storage.modifier.async.ts
1794 2: storage.type.property.ts
1795 3: keyword.generator.asterisk.ts
1796 push:
1797 - match: (?=\(|\<)
1798 pop: true
1799 - include: method-declaration-name
1800 object-member:
1801 - include: comment
1802 - include: object-literal-method-declaration
1803 - match: '(?=\[)'
1804 push:
1805 - meta_scope: meta.object.member.ts meta.object-literal.key.ts
1806 - match: '(?=:)|((?<=[\]])(?=\s*[\(\<]))'
1807 pop: true
1808 - include: comment
1809 - include: array-literal
1810 - match: '(?=[\''\"\`])'
1811 push:
1812 - meta_scope: meta.object.member.ts meta.object-literal.key.ts
1813 - match: '(?=:)|((?<=[\''\"\`])(?=((\s*[\(\<,}])|(\s+(as)\s+))))'
1814 pop: true
1815 - include: comment
1816 - include: string
1817 - match: |-
1818 (?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(?!\$))|((?<!\$)(?:
1819 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1820 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1821 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1822 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1823 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1824 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1825 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1826 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1827 )(?!\$)))
1828 push:
1829 - meta_scope: meta.object.member.ts meta.object-literal.key.ts
1830 - match: '(?=:)|(?=\s*([\(\<,}])|(\s+as\s+))'
1831 pop: true
1832 - include: comment
1833 - include: numeric-literal
1834 - match: '(?<=[\]\''\"\`])(?=\s*[\(\<])'
1835 push:
1836 - meta_scope: meta.method.declaration.ts
1837 - match: '(?=\}|;|,)|(?<=\})'
1838 pop: true
1839 - include: function-body
1840 - match: '(?![_$[:alpha:]])([[:digit:]]+)\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*:)'
1841 scope: meta.object.member.ts
1842 captures:
1843 0: meta.object-literal.key.ts
1844 1: constant.numeric.decimal.ts
1845 - match: |-
1846 (?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*:(\s*\/\*([^\*]|(\*[^\/]))*\*\/)*\s*(
1847 ((async\s+)?(
1848 (function\s*[(<*]) |
1849 (function\s+) |
1850 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1851 )) |
1852 ((async\s*)?(
1853 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1854 # sure shot arrow functions even if => is on new line
1856 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1857 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1859 ([)]\s*:) | # ():
1860 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1862 ) |
1864 # arrow function possible to detect only with => on same line
1866 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1867 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1868 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1869 \s*=> # arrow operator
1871 ))
1872 )))
1873 scope: meta.object.member.ts
1874 captures:
1875 0: meta.object-literal.key.ts
1876 1: entity.name.function.ts
1877 - match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*:)'
1878 scope: meta.object.member.ts
1879 captures:
1880 0: meta.object-literal.key.ts
1881 - match: \.\.\.
1882 captures:
1883 0: keyword.operator.spread.ts
1884 push:
1885 - meta_scope: meta.object.member.ts
1886 - match: '(?=,|\})'
1887 pop: true
1888 - include: expression
1889 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?=,|\}|$|\/\/|\/\*)'
1890 scope: meta.object.member.ts
1891 captures:
1892 1: variable.other.readwrite.ts
1893 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+(const)(?=\s*([,}]|$))'
1894 scope: meta.object.member.ts
1895 captures:
1896 1: keyword.control.as.ts
1897 2: storage.modifier.ts
1898 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+'
1899 captures:
1900 1: keyword.control.as.ts
1901 push:
1902 - meta_scope: meta.object.member.ts
1903 - match: '(?=$|^|[,}]|\|\||\&\&|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+))'
1904 pop: true
1905 - include: type
1906 - match: '(?=[_$[:alpha:]][_$[:alnum:]]*\s*=)'
1907 push:
1908 - meta_scope: meta.object.member.ts
1909 - match: '(?=,|\}|$|\/\/|\/\*)'
1910 pop: true
1911 - include: expression
1912 - match: ":"
1913 captures:
1914 0: meta.object-literal.key.ts punctuation.separator.key-value.ts
1915 push:
1916 - meta_scope: meta.object.member.ts
1917 - match: '(?=,|\})'
1918 pop: true
1919 - match: '(?<=:)\s*(async)?(?=\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)\(\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1920 captures:
1921 1: storage.modifier.async.ts
1922 push:
1923 - match: (?<=\))
1924 pop: true
1925 - include: type-parameters
1926 - match: \(
1927 captures:
1928 0: meta.brace.round.ts
1929 push:
1930 - match: \)
1931 captures:
1932 0: meta.brace.round.ts
1933 pop: true
1934 - include: expression-inside-possibly-arrow-parens
1935 - match: '(?<=:)\s*(async)?\s*(\()(?=\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1936 captures:
1937 1: storage.modifier.async.ts
1938 2: meta.brace.round.ts
1939 push:
1940 - match: \)
1941 captures:
1942 0: meta.brace.round.ts
1943 pop: true
1944 - include: expression-inside-possibly-arrow-parens
1945 - match: (?<=:)\s*(async)?\s*(?=\<\s*$)
1946 captures:
1947 1: storage.modifier.async.ts
1948 push:
1949 - match: (?<=\>)
1950 pop: true
1951 - include: type-parameters
1952 - match: '(?<=\>)\s*(\()(?=\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1953 captures:
1954 1: meta.brace.round.ts
1955 push:
1956 - match: \)
1957 captures:
1958 0: meta.brace.round.ts
1959 pop: true
1960 - include: expression-inside-possibly-arrow-parens
1961 - include: possibly-arrow-return-type
1962 - include: expression
1963 - include: punctuation-comma
1964 parameter-array-binding-pattern:
1965 - match: '(?:(\.\.\.)\s*)?(\[)'
1966 captures:
1967 1: keyword.operator.rest.ts
1968 2: punctuation.definition.binding-pattern.array.ts
1969 push:
1970 - match: '\]'
1971 captures:
1972 0: punctuation.definition.binding-pattern.array.ts
1973 pop: true
1974 - include: parameter-binding-element
1975 - include: punctuation-comma
1976 parameter-binding-element:
1977 - include: comment
1978 - include: string
1979 - include: numeric-literal
1980 - include: regex
1981 - include: parameter-object-binding-pattern
1982 - include: parameter-array-binding-pattern
1983 - include: destructuring-parameter-rest
1984 - include: variable-initializer
1985 parameter-name:
1986 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|protected|private|readonly)\s+(?=(public|protected|private|readonly)\s+)'
1987 captures:
1988 1: storage.modifier.ts
1989 - match: |-
1990 (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*
1991 # function assignment |
1992 (=\s*(
1993 ((async\s+)?(
1994 (function\s*[(<*]) |
1995 (function\s+) |
1996 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1997 )) |
1998 ((async\s*)?(
1999 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
2000 # sure shot arrow functions even if => is on new line
2002 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
2003 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
2005 ([)]\s*:) | # ():
2006 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
2008 ) |
2010 # arrow function possible to detect only with => on same line
2012 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
2013 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
2014 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
2015 \s*=> # arrow operator
2017 ))
2018 )) |
2019 # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
2020 (:\s*(
2021 (<) |
2022 ([(]\s*(
2023 ([)]) |
2024 (\.\.\.) |
2025 ([_$[:alnum:]]+\s*(
2026 ([:,?=])|
2027 ([)]\s*=>)
2028 ))
2029 ))
2030 )) |
2031 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
2032 (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
2033 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
2034 ((async\s+)?(
2035 (function\s*[(<*]) |
2036 (function\s+) |
2037 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
2038 )) |
2039 ((async\s*)?(
2040 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
2041 # sure shot arrow functions even if => is on new line
2043 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
2044 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
2046 ([)]\s*:) | # ():
2047 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
2049 ) |
2051 # arrow function possible to detect only with => on same line
2053 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
2054 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
2055 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
2056 \s*=> # arrow operator
2058 ))
2059 )))
2060 captures:
2061 1: storage.modifier.ts
2062 2: keyword.operator.rest.ts
2063 3: entity.name.function.ts variable.language.this.ts
2064 4: entity.name.function.ts
2065 5: keyword.operator.optional.ts
2066 - match: '(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)'
2067 captures:
2068 1: storage.modifier.ts
2069 2: keyword.operator.rest.ts
2070 3: variable.parameter.ts variable.language.this.ts
2071 4: variable.parameter.ts
2072 5: keyword.operator.optional.ts
2073 parameter-object-binding-element:
2074 - include: comment
2075 - match: |-
2076 (?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(?!\$))|((?<!\$)(?:
2077 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
2078 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
2079 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
2080 (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
2081 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
2082 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
2083 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
2084 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
2085 )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
2086 push:
2087 - match: '(?=,|\})'
2088 pop: true
2089 - include: object-binding-element-propertyName
2090 - include: parameter-binding-element
2091 - include: parameter-object-binding-pattern
2092 - include: destructuring-parameter-rest
2093 - include: variable-initializer
2094 - include: punctuation-comma
2095 parameter-object-binding-pattern:
2096 - match: '(?:(\.\.\.)\s*)?(\{)'
2097 captures:
2098 1: keyword.operator.rest.ts
2099 2: punctuation.definition.binding-pattern.object.ts
2100 push:
2101 - match: '\}'
2102 captures:
2103 0: punctuation.definition.binding-pattern.object.ts
2104 pop: true
2105 - include: parameter-object-binding-element
2106 parameter-type-annotation:
2107 - match: (:)
2108 captures:
2109 1: keyword.operator.type.annotation.ts
2110 push:
2111 - meta_scope: meta.type.annotation.ts
2112 - match: "(?=[,)])|(?==[^>])"
2113 pop: true
2114 - include: type
2115 paren-expression:
2116 - match: \(
2117 captures:
2118 0: meta.brace.round.ts
2119 push:
2120 - match: \)
2121 captures:
2122 0: meta.brace.round.ts
2123 pop: true
2124 - include: expression
2125 paren-expression-possibly-arrow:
2126 - match: '(?<=[(=,])\s*(async)?(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?\(\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
2127 captures:
2128 1: storage.modifier.async.ts
2129 push:
2130 - match: (?<=\))
2131 pop: true
2132 - include: paren-expression-possibly-arrow-with-typeparameters
2133 - match: '(?<=[(=,]|=>|^return|[^\._$[:alnum:]]return)\s*(async)?(?=\s*((((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?\()|(<))\s*$)'
2134 captures:
2135 1: storage.modifier.async.ts
2136 push:
2137 - match: (?<=\))
2138 pop: true
2139 - include: paren-expression-possibly-arrow-with-typeparameters
2140 - include: possibly-arrow-return-type
2141 paren-expression-possibly-arrow-with-typeparameters:
2142 - include: type-parameters
2143 - match: \(
2144 captures:
2145 0: meta.brace.round.ts
2146 push:
2147 - match: \)
2148 captures:
2149 0: meta.brace.round.ts
2150 pop: true
2151 - include: expression-inside-possibly-arrow-parens
2152 possibly-arrow-return-type:
2153 - match: '(?<=\)|^)\s*(:)(?=\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*=>)'
2154 captures:
2155 1: meta.arrow.ts meta.return.type.arrow.ts keyword.operator.type.annotation.ts
2156 push:
2157 - meta_content_scope: meta.arrow.ts meta.return.type.arrow.ts
2158 - match: '(?==>|\{|(^\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\s+))'
2159 pop: true
2160 - include: arrow-return-type-body
2161 property-accessor:
2162 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(get|set)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2163 scope: storage.type.property.ts
2164 punctuation-accessor:
2165 - match: '(?:(\.)|(\?\.(?!\s*[[:digit:]])))'
2166 captures:
2167 1: punctuation.accessor.ts
2168 2: punctuation.accessor.optional.ts
2169 punctuation-comma:
2170 - match: ","
2171 scope: punctuation.separator.comma.ts
2172 punctuation-semicolon:
2173 - match: ;
2174 scope: punctuation.terminator.statement.ts
2175 qstring-double:
2176 - match: '"'
2177 captures:
2178 0: punctuation.definition.string.begin.ts
2179 push:
2180 - meta_scope: string.quoted.double.ts
2181 - match: '(")|((?:[^\\\n])$)'
2182 captures:
2183 1: punctuation.definition.string.end.ts
2184 2: invalid.illegal.newline.ts
2185 pop: true
2186 - include: string-character-escape
2187 qstring-single:
2188 - match: "'"
2189 captures:
2190 0: punctuation.definition.string.begin.ts
2191 push:
2192 - meta_scope: string.quoted.single.ts
2193 - match: '(\'')|((?:[^\\\n])$)'
2194 captures:
2195 1: punctuation.definition.string.end.ts
2196 2: invalid.illegal.newline.ts
2197 pop: true
2198 - include: string-character-escape
2199 regex:
2200 - match: '(?<!\+\+|--|})(?<=[=(:,\[?+!]|^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[\()]|\\.|\[([^\]\\]|\\.)+\]|\(([^\)\\]|\\.)+\))+\/([gimsuy]+|(?![\/\*])|(?=\/\*))(?!\s*[a-zA-Z0-9_$]))'
2201 captures:
2202 1: punctuation.definition.string.begin.ts
2203 push:
2204 - meta_scope: string.regexp.ts
2205 - match: "(/)([gimsuy]*)"
2206 captures:
2207 1: punctuation.definition.string.end.ts
2208 2: keyword.other.ts
2209 pop: true
2210 - include: regexp
2211 - match: '((?<![_$[:alnum:])\]]|\+\+|--|}|\*\/)|((?<=^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case))\s*)\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/([gimsuy]+|(?![\/\*])|(?=\/\*))(?!\s*[a-zA-Z0-9_$]))'
2212 captures:
2213 0: punctuation.definition.string.begin.ts
2214 push:
2215 - meta_scope: string.regexp.ts
2216 - match: "(/)([gimsuy]*)"
2217 captures:
2218 1: punctuation.definition.string.end.ts
2219 2: keyword.other.ts
2220 pop: true
2221 - include: regexp
2222 regex-character-class:
2223 - match: '\\[wWsSdDtrnvf]|\.'
2224 scope: constant.other.character-class.regexp
2225 - match: '\\([0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4})'
2226 scope: constant.character.numeric.regexp
2227 - match: '\\c[A-Z]'
2228 scope: constant.character.control.regexp
2229 - match: \\.
2230 scope: constant.character.escape.backslash.regexp
2231 regexp:
2232 - match: '\\[bB]|\^|\$'
2233 scope: keyword.control.anchor.regexp
2234 - match: '\\[1-9]\d*|\\k<([a-zA-Z_$][\w$]*)>'
2235 captures:
2236 0: keyword.other.back-reference.regexp
2237 1: variable.other.regexp
2238 - match: '[?+*]|\{(\d+,\d+|\d+,|,\d+|\d+)\}\??'
2239 scope: keyword.operator.quantifier.regexp
2240 - match: \|
2241 scope: keyword.operator.or.regexp
2242 - match: (\()((\?=)|(\?!)|(\?<=)|(\?<!))
2243 captures:
2244 1: punctuation.definition.group.regexp
2245 2: punctuation.definition.group.assertion.regexp
2246 3: meta.assertion.look-ahead.regexp
2247 4: meta.assertion.negative-look-ahead.regexp
2248 5: meta.assertion.look-behind.regexp
2249 6: meta.assertion.negative-look-behind.regexp
2250 push:
2251 - meta_scope: meta.group.assertion.regexp
2252 - match: (\))
2253 captures:
2254 1: punctuation.definition.group.regexp
2255 pop: true
2256 - include: regexp
2257 - match: '\((?:(\?:)|(?:\?<([a-zA-Z_$][\w$]*)>))?'
2258 captures:
2259 0: punctuation.definition.group.regexp
2260 1: punctuation.definition.group.no-capture.regexp
2261 2: variable.other.regexp
2262 push:
2263 - meta_scope: meta.group.regexp
2264 - match: \)
2265 captures:
2266 0: punctuation.definition.group.regexp
2267 pop: true
2268 - include: regexp
2269 - match: '(\[)(\^)?'
2270 captures:
2271 1: punctuation.definition.character-class.regexp
2272 2: keyword.operator.negation.regexp
2273 push:
2274 - meta_scope: constant.other.character-class.set.regexp
2275 - match: '(\])'
2276 captures:
2277 1: punctuation.definition.character-class.regexp
2278 pop: true
2279 - 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])|(\\.))'
2280 scope: constant.other.character-class.range.regexp
2281 captures:
2282 1: constant.character.numeric.regexp
2283 2: constant.character.control.regexp
2284 3: constant.character.escape.backslash.regexp
2285 4: constant.character.numeric.regexp
2286 5: constant.character.control.regexp
2287 6: constant.character.escape.backslash.regexp
2288 - include: regex-character-class
2289 - include: regex-character-class
2290 return-type:
2291 - match: (?<=\))\s*(:)(?=\s*\S)
2292 captures:
2293 1: keyword.operator.type.annotation.ts
2294 push:
2295 - meta_scope: meta.return.type.ts
2296 - match: "(?<![:|&])(?=$|^|[{};,]|//)"
2297 pop: true
2298 - include: return-type-core
2299 - match: (?<=\))\s*(:)
2300 captures:
2301 1: keyword.operator.type.annotation.ts
2302 push:
2303 - meta_scope: meta.return.type.ts
2304 - match: '(?<![:|&])((?=[{};,]|//|^\s*$)|((?<=\S)(?=\s*$)))'
2305 pop: true
2306 - include: return-type-core
2307 return-type-core:
2308 - include: comment
2309 - match: '(?<=[:|&])(?=\s*\{)'
2310 push:
2311 - match: '(?<=\})'
2312 pop: true
2313 - include: type-object
2314 - include: type-predicate-operator
2315 - include: type
2316 single-line-comment-consuming-line-ending:
2317 - match: '(^[ \t]+)?((//)(?:\s*((@)internal)(?=\s|$))?)'
2318 captures:
2319 1: punctuation.whitespace.comment.leading.ts
2320 2: comment.line.double-slash.ts
2321 3: punctuation.definition.comment.ts
2322 4: storage.type.internaldeclaration.ts
2323 5: punctuation.decorator.internaldeclaration.ts
2324 push:
2325 - meta_content_scope: comment.line.double-slash.ts
2326 - match: (?=^)
2327 pop: true
2328 statements:
2329 - include: declaration
2330 - include: control-statement
2331 - include: after-operator-block-as-object-literal
2332 - include: decl-block
2333 - include: label
2334 - include: expression
2335 - include: punctuation-semicolon
2336 - include: string
2337 - include: comment
2338 string:
2339 - include: qstring-single
2340 - include: qstring-double
2341 - include: template
2342 string-character-escape:
2343 - 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]?|.|$)'
2344 scope: constant.character.escape.ts
2345 super-literal:
2346 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))super\b(?!\$)'
2347 scope: variable.language.super.ts
2348 support-function-call-identifiers:
2349 - include: literal
2350 - include: support-objects
2351 - include: object-identifiers
2352 - include: punctuation-accessor
2353 - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))import(?=\s*[\(]\s*[\"\''\`]))'
2354 scope: keyword.operator.expression.import.ts
2355 support-objects:
2356 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(arguments)\b(?!\$)'
2357 scope: variable.language.arguments.ts
2358 - match: |-
2359 (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(Array|ArrayBuffer|Atomics|BigInt|BigInt64Array|BigUint64Array|Boolean|DataView|Date|Float32Array
2360 |Float64Array|Function|Generator|GeneratorFunction|Int8Array|Int16Array|Int32Array|Intl|Map|Number|Object|Proxy
2361 |Reflect|RegExp|Set|SharedArrayBuffer|SIMD|String|Symbol|TypedArray
2362 |Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|WeakMap|WeakSet)\b(?!\$)
2363 scope: support.class.builtin.ts
2364 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))((Eval|Internal|Range|Reference|Syntax|Type|URI)?Error)\b(?!\$)'
2365 scope: support.class.error.ts
2366 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(Promise)\b(?!\$)'
2367 scope: support.class.promise.ts
2368 - match: |-
2369 (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(clear(Interval|Timeout)|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|
2370 isFinite|isNaN|parseFloat|parseInt|require|set(Interval|Timeout)|super|unescape|uneval)(?=\s*\()
2371 scope: support.function.ts
2372 - match: |-
2373 (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(Math)(?:\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(?:
2374 (abs|acos|acosh|asin|asinh|atan|atan2|atanh|cbrt|ceil|clz32|cos|cosh|exp|
2375 expm1|floor|fround|hypot|imul|log|log10|log1p|log2|max|min|pow|random|
2376 round|sign|sin|sinh|sqrt|tan|tanh|trunc)
2378 (E|LN10|LN2|LOG10E|LOG2E|PI|SQRT1_2|SQRT2)))?\b(?!\$)
2379 captures:
2380 1: support.constant.math.ts
2381 2: punctuation.accessor.ts
2382 3: punctuation.accessor.optional.ts
2383 4: support.function.math.ts
2384 5: support.constant.property.math.ts
2385 - match: |-
2386 (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(console)(?:\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(
2387 assert|clear|count|debug|dir|error|group|groupCollapsed|groupEnd|info|log
2388 |profile|profileEnd|table|time|timeEnd|timeStamp|trace|warn))?\b(?!\$)
2389 captures:
2390 1: support.class.console.ts
2391 2: punctuation.accessor.ts
2392 3: punctuation.accessor.optional.ts
2393 4: support.function.console.ts
2394 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(JSON)(?:\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(parse|stringify))?\b(?!\$)'
2395 captures:
2396 1: support.constant.json.ts
2397 2: punctuation.accessor.ts
2398 3: punctuation.accessor.optional.ts
2399 4: support.function.json.ts
2400 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(import)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(meta)\b(?!\$)'
2401 captures:
2402 1: keyword.control.import.ts
2403 2: punctuation.accessor.ts
2404 3: punctuation.accessor.optional.ts
2405 4: support.variable.property.importmeta.ts
2406 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(target)\b(?!\$)'
2407 captures:
2408 1: keyword.operator.new.ts
2409 2: punctuation.accessor.ts
2410 3: punctuation.accessor.optional.ts
2411 4: support.variable.property.target.ts
2412 - match: |-
2413 (?x) (?:(\.)|(\?\.(?!\s*[[:digit:]]))) \s* (?:
2414 (?:(constructor|length|prototype|__proto__)\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?\())
2416 (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\b(?!\$)))
2417 captures:
2418 1: punctuation.accessor.ts
2419 2: punctuation.accessor.optional.ts
2420 3: support.variable.property.ts
2421 4: support.constant.ts
2422 - match: |-
2423 (?x) (?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.)) \b (?:
2424 (document|event|navigator|performance|screen|window)
2426 (AnalyserNode|ArrayBufferView|Attr|AudioBuffer|AudioBufferSourceNode|AudioContext|AudioDestinationNode|AudioListener
2427 |AudioNode|AudioParam|BatteryManager|BeforeUnloadEvent|BiquadFilterNode|Blob|BufferSource|ByteString|CSS|CSSConditionRule
2428 |CSSCounterStyleRule|CSSGroupingRule|CSSMatrix|CSSMediaRule|CSSPageRule|CSSPrimitiveValue|CSSRule|CSSRuleList|CSSStyleDeclaration
2429 |CSSStyleRule|CSSStyleSheet|CSSSupportsRule|CSSValue|CSSValueList|CanvasGradient|CanvasImageSource|CanvasPattern
2430 |CanvasRenderingContext2D|ChannelMergerNode|ChannelSplitterNode|CharacterData|ChromeWorker|CloseEvent|Comment|CompositionEvent
2431 |Console|ConvolverNode|Coordinates|Credential|CredentialsContainer|Crypto|CryptoKey|CustomEvent|DOMError|DOMException
2432 |DOMHighResTimeStamp|DOMImplementation|DOMString|DOMStringList|DOMStringMap|DOMTimeStamp|DOMTokenList|DataTransfer
2433 |DataTransferItem|DataTransferItemList|DedicatedWorkerGlobalScope|DelayNode|DeviceProximityEvent|DirectoryEntry
2434 |DirectoryEntrySync|DirectoryReader|DirectoryReaderSync|Document|DocumentFragment|DocumentTouch|DocumentType|DragEvent
2435 |DynamicsCompressorNode|Element|Entry|EntrySync|ErrorEvent|Event|EventListener|EventSource|EventTarget|FederatedCredential
2436 |FetchEvent|File|FileEntry|FileEntrySync|FileException|FileList|FileReader|FileReaderSync|FileSystem|FileSystemSync
2437 |FontFace|FormData|GainNode|Gamepad|GamepadButton|GamepadEvent|Geolocation|GlobalEventHandlers|HTMLAnchorElement
2438 |HTMLAreaElement|HTMLAudioElement|HTMLBRElement|HTMLBaseElement|HTMLBodyElement|HTMLButtonElement|HTMLCanvasElement
2439 |HTMLCollection|HTMLContentElement|HTMLDListElement|HTMLDataElement|HTMLDataListElement|HTMLDialogElement|HTMLDivElement
2440 |HTMLDocument|HTMLElement|HTMLEmbedElement|HTMLFieldSetElement|HTMLFontElement|HTMLFormControlsCollection|HTMLFormElement
2441 |HTMLHRElement|HTMLHeadElement|HTMLHeadingElement|HTMLHtmlElement|HTMLIFrameElement|HTMLImageElement|HTMLInputElement
2442 |HTMLKeygenElement|HTMLLIElement|HTMLLabelElement|HTMLLegendElement|HTMLLinkElement|HTMLMapElement|HTMLMediaElement
2443 |HTMLMetaElement|HTMLMeterElement|HTMLModElement|HTMLOListElement|HTMLObjectElement|HTMLOptGroupElement|HTMLOptionElement
2444 |HTMLOptionsCollection|HTMLOutputElement|HTMLParagraphElement|HTMLParamElement|HTMLPreElement|HTMLProgressElement
2445 |HTMLQuoteElement|HTMLScriptElement|HTMLSelectElement|HTMLShadowElement|HTMLSourceElement|HTMLSpanElement|HTMLStyleElement
2446 |HTMLTableCaptionElement|HTMLTableCellElement|HTMLTableColElement|HTMLTableDataCellElement|HTMLTableElement|HTMLTableHeaderCellElement
2447 |HTMLTableRowElement|HTMLTableSectionElement|HTMLTextAreaElement|HTMLTimeElement|HTMLTitleElement|HTMLTrackElement
2448 |HTMLUListElement|HTMLUnknownElement|HTMLVideoElement|HashChangeEvent|History|IDBCursor|IDBCursorWithValue|IDBDatabase
2449 |IDBEnvironment|IDBFactory|IDBIndex|IDBKeyRange|IDBMutableFile|IDBObjectStore|IDBOpenDBRequest|IDBRequest|IDBTransaction
2450 |IDBVersionChangeEvent|IIRFilterNode|IdentityManager|ImageBitmap|ImageBitmapFactories|ImageData|Index|InputDeviceCapabilities
2451 |InputEvent|InstallEvent|InstallTrigger|KeyboardEvent|LinkStyle|LocalFileSystem|LocalFileSystemSync|Location|MIDIAccess
2452 |MIDIConnectionEvent|MIDIInput|MIDIInputMap|MIDIOutputMap|MediaElementAudioSourceNode|MediaError|MediaKeyMessageEvent
2453 |MediaKeySession|MediaKeyStatusMap|MediaKeySystemAccess|MediaKeySystemConfiguration|MediaKeys|MediaRecorder|MediaStream
2454 |MediaStreamAudioDestinationNode|MediaStreamAudioSourceNode|MessageChannel|MessageEvent|MessagePort|MouseEvent
2455 |MutationObserver|MutationRecord|NamedNodeMap|Navigator|NavigatorConcurrentHardware|NavigatorGeolocation|NavigatorID
2456 |NavigatorLanguage|NavigatorOnLine|Node|NodeFilter|NodeIterator|NodeList|NonDocumentTypeChildNode|Notification
2457 |OfflineAudioCompletionEvent|OfflineAudioContext|OscillatorNode|PageTransitionEvent|PannerNode|ParentNode|PasswordCredential
2458 |Path2D|PaymentAddress|PaymentRequest|PaymentResponse|Performance|PerformanceEntry|PerformanceFrameTiming|PerformanceMark
2459 |PerformanceMeasure|PerformanceNavigation|PerformanceNavigationTiming|PerformanceObserver|PerformanceObserverEntryList
2460 |PerformanceResourceTiming|PerformanceTiming|PeriodicSyncEvent|PeriodicWave|Plugin|Point|PointerEvent|PopStateEvent
2461 |PortCollection|Position|PositionError|PositionOptions|PresentationConnectionClosedEvent|PresentationConnectionList
2462 |PresentationReceiver|ProcessingInstruction|ProgressEvent|PromiseRejectionEvent|PushEvent|PushRegistrationManager
2463 |RTCCertificate|RTCConfiguration|RTCPeerConnection|RTCSessionDescriptionCallback|RTCStatsReport|RadioNodeList|RandomSource
2464 |Range|ReadableByteStream|RenderingContext|SVGAElement|SVGAngle|SVGAnimateColorElement|SVGAnimateElement|SVGAnimateMotionElement
2465 |SVGAnimateTransformElement|SVGAnimatedAngle|SVGAnimatedBoolean|SVGAnimatedEnumeration|SVGAnimatedInteger|SVGAnimatedLength
2466 |SVGAnimatedLengthList|SVGAnimatedNumber|SVGAnimatedNumberList|SVGAnimatedPoints|SVGAnimatedPreserveAspectRatio
2467 |SVGAnimatedRect|SVGAnimatedString|SVGAnimatedTransformList|SVGAnimationElement|SVGCircleElement|SVGClipPathElement
2468 |SVGCursorElement|SVGDefsElement|SVGDescElement|SVGElement|SVGEllipseElement|SVGEvent|SVGFilterElement|SVGFontElement
2469 |SVGFontFaceElement|SVGFontFaceFormatElement|SVGFontFaceNameElement|SVGFontFaceSrcElement|SVGFontFaceUriElement
2470 |SVGForeignObjectElement|SVGGElement|SVGGlyphElement|SVGGradientElement|SVGHKernElement|SVGImageElement|SVGLength
2471 |SVGLengthList|SVGLineElement|SVGLinearGradientElement|SVGMPathElement|SVGMaskElement|SVGMatrix|SVGMissingGlyphElement
2472 |SVGNumber|SVGNumberList|SVGPathElement|SVGPatternElement|SVGPoint|SVGPolygonElement|SVGPolylineElement|SVGPreserveAspectRatio
2473 |SVGRadialGradientElement|SVGRect|SVGRectElement|SVGSVGElement|SVGScriptElement|SVGSetElement|SVGStopElement|SVGStringList
2474 |SVGStylable|SVGStyleElement|SVGSwitchElement|SVGSymbolElement|SVGTRefElement|SVGTSpanElement|SVGTests|SVGTextElement
2475 |SVGTextPositioningElement|SVGTitleElement|SVGTransform|SVGTransformList|SVGTransformable|SVGUseElement|SVGVKernElement
2476 |SVGViewElement|ServiceWorker|ServiceWorkerContainer|ServiceWorkerGlobalScope|ServiceWorkerRegistration|ServiceWorkerState
2477 |ShadowRoot|SharedWorker|SharedWorkerGlobalScope|SourceBufferList|StereoPannerNode|Storage|StorageEvent|StyleSheet
2478 |StyleSheetList|SubtleCrypto|SyncEvent|Text|TextMetrics|TimeEvent|TimeRanges|Touch|TouchEvent|TouchList|Transferable
2479 |TreeWalker|UIEvent|USVString|VRDisplayCapabilities|ValidityState|WaveShaperNode|WebGL|WebGLActiveInfo|WebGLBuffer
2480 |WebGLContextEvent|WebGLFramebuffer|WebGLProgram|WebGLRenderbuffer|WebGLRenderingContext|WebGLShader|WebGLShaderPrecisionFormat
2481 |WebGLTexture|WebGLTimerQueryEXT|WebGLTransformFeedback|WebGLUniformLocation|WebGLVertexArrayObject|WebGLVertexArrayObjectOES
2482 |WebSocket|WebSockets|WebVTT|WheelEvent|Window|WindowBase64|WindowEventHandlers|WindowTimers|Worker|WorkerGlobalScope
2483 |WorkerLocation|WorkerNavigator|XMLHttpRequest|XMLHttpRequestEventTarget|XMLSerializer|XPathExpression|XPathResult
2484 |XSLTProcessor))\b(?!\$)
2485 captures:
2486 1: support.variable.dom.ts
2487 2: support.class.dom.ts
2488 - match: |-
2489 (?x) (?:(\.)|(\?\.(?!\s*[[:digit:]]))) \s* (?:
2490 (ATTRIBUTE_NODE|CDATA_SECTION_NODE|COMMENT_NODE|DOCUMENT_FRAGMENT_NODE|DOCUMENT_NODE|DOCUMENT_TYPE_NODE
2491 |DOMSTRING_SIZE_ERR|ELEMENT_NODE|ENTITY_NODE|ENTITY_REFERENCE_NODE|HIERARCHY_REQUEST_ERR|INDEX_SIZE_ERR
2492 |INUSE_ATTRIBUTE_ERR|INVALID_CHARACTER_ERR|NO_DATA_ALLOWED_ERR|NO_MODIFICATION_ALLOWED_ERR|NOT_FOUND_ERR
2493 |NOT_SUPPORTED_ERR|NOTATION_NODE|PROCESSING_INSTRUCTION_NODE|TEXT_NODE|WRONG_DOCUMENT_ERR)
2495 (_content|[xyz]|abbr|above|accept|acceptCharset|accessKey|action|align|[av]Link(?:color)?|all|alt|anchors|appCodeName
2496 |appCore|applets|appMinorVersion|appName|appVersion|archive|areas|arguments|attributes|availHeight|availLeft|availTop
2497 |availWidth|axis|background|backgroundColor|backgroundImage|below|bgColor|body|border|borderBottomWidth|borderColor
2498 |borderLeftWidth|borderRightWidth|borderStyle|borderTopWidth|borderWidth|bottom|bufferDepth|callee|caller|caption
2499 |cellPadding|cells|cellSpacing|ch|characterSet|charset|checked|childNodes|chOff|cite|classes|className|clear
2500 |clientInformation|clip|clipBoardData|closed|code|codeBase|codeType|color|colorDepth|cols|colSpan|compact|complete
2501 |components|content|controllers|cookie|cookieEnabled|cords|cpuClass|crypto|current|data|dateTime|declare|defaultCharset
2502 |defaultChecked|defaultSelected|defaultStatus|defaultValue|defaultView|defer|description|dialogArguments|dialogHeight
2503 |dialogLeft|dialogTop|dialogWidth|dir|directories|disabled|display|docmain|doctype|documentElement|elements|embeds
2504 |enabledPlugin|encoding|enctype|entities|event|expando|external|face|fgColor|filename|firstChild|fontFamily|fontSize
2505 |fontWeight|form|formName|forms|frame|frameBorder|frameElement|frames|hasFocus|hash|headers|height|history|host
2506 |hostname|href|hreflang|hspace|htmlFor|httpEquiv|id|ids|ignoreCase|images|implementation|index|innerHeight|innerWidth
2507 |input|isMap|label|lang|language|lastChild|lastIndex|lastMatch|lastModified|lastParen|layer[sXY]|left|leftContext
2508 |lineHeight|link|linkColor|links|listStyleType|localName|location|locationbar|longDesc|lowsrc|lowSrc|marginBottom
2509 |marginHeight|marginLeft|marginRight|marginTop|marginWidth|maxLength|media|menubar|method|mimeTypes|multiline|multiple
2510 |name|nameProp|namespaces|namespaceURI|next|nextSibling|nodeName|nodeType|nodeValue|noHref|noResize|noShade|notationName
2511 |notations|noWrap|object|offscreenBuffering|onLine|onreadystatechange|opener|opsProfile|options|oscpu|outerHeight
2512 |outerWidth|ownerDocument|paddingBottom|paddingLeft|paddingRight|paddingTop|page[XY]|page[XY]Offset|parent|parentLayer
2513 |parentNode|parentWindow|pathname|personalbar|pixelDepth|pkcs11|platform|plugins|port|prefix|previous|previousDibling
2514 |product|productSub|profile|profileend|prompt|prompter|protocol|publicId|readOnly|readyState|referrer|rel|responseText
2515 |responseXML|rev|right|rightContext|rowIndex|rows|rowSpan|rules|scheme|scope|screen[XY]|screenLeft|screenTop|scripts
2516 |scrollbars|scrolling|sectionRowIndex|security|securityPolicy|selected|selectedIndex|selection|self|shape|siblingAbove
2517 |siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary
2518 |systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead
2519 |title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile
2520 |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?\()
2521 captures:
2522 1: punctuation.accessor.ts
2523 2: punctuation.accessor.optional.ts
2524 3: support.constant.dom.ts
2525 4: support.variable.property.dom.ts
2526 - match: |-
2527 (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(Buffer|EventEmitter|Server|Pipe|Socket|REPLServer|ReadStream|WriteStream|Stream
2528 |Inflate|Deflate|InflateRaw|DeflateRaw|GZip|GUnzip|Unzip|Zip)\b(?!\$)
2529 scope: support.class.node.ts
2530 - match: |-
2531 (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(process)(?:(?:(\.)|(\?\.(?!\s*[[:digit:]])))(?:
2532 (arch|argv|config|connected|env|execArgv|execPath|exitCode|mainModule|pid|platform|release|stderr|stdin|stdout|title|version|versions)
2534 (abort|chdir|cwd|disconnect|exit|[sg]ete?[gu]id|send|[sg]etgroups|initgroups|kill|memoryUsage|nextTick|umask|uptime|hrtime)
2535 ))?\b(?!\$)
2536 captures:
2537 1: support.variable.object.process.ts
2538 2: punctuation.accessor.ts
2539 3: punctuation.accessor.optional.ts
2540 4: support.variable.property.process.ts
2541 5: support.function.process.ts
2542 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(exports)|(module)(?:(?:(\.)|(\?\.(?!\s*[[:digit:]])))(exports|id|filename|loaded|parent|children))?)\b(?!\$)'
2543 captures:
2544 1: support.type.object.module.ts
2545 2: support.type.object.module.ts
2546 3: punctuation.accessor.ts
2547 4: punctuation.accessor.optional.ts
2548 5: support.type.object.module.ts
2549 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(global|GLOBAL|root|__dirname|__filename)\b(?!\$)'
2550 scope: support.variable.object.node.ts
2551 - match: |-
2552 (?x) (?:(\.)|(\?\.(?!\s*[[:digit:]]))) \s*
2553 (?:
2554 (on(?:Rowsinserted|Rowsdelete|Rowenter|Rowexit|Resize|Resizestart|Resizeend|Reset|
2555 Readystatechange|Mouseout|Mouseover|Mousedown|Mouseup|Mousemove|
2556 Before(?:cut|deactivate|unload|update|paste|print|editfocus|activate)|
2557 Blur|Scrolltop|Submit|Select|Selectstart|Selectionchange|Hover|Help|
2558 Change|Contextmenu|Controlselect|Cut|Cellchange|Clock|Close|Deactivate|
2559 Datasetchanged|Datasetcomplete|Dataavailable|Drop|Drag|Dragstart|Dragover|
2560 Dragdrop|Dragenter|Dragend|Dragleave|Dblclick|Unload|Paste|Propertychange|Error|
2561 Errorupdate|Keydown|Keyup|Keypress|Focus|Load|Activate|Afterupdate|Afterprint|Abort)
2562 ) |
2563 (shift|showModelessDialog|showModalDialog|showHelp|scroll|scrollX|scrollByPages|
2564 scrollByLines|scrollY|scrollTo|stop|strike|sizeToContent|sidebar|signText|sort|
2565 sup|sub|substr|substring|splice|split|send|set(?:Milliseconds|Seconds|Minutes|Hours|
2566 Month|Year|FullYear|Date|UTC(?:Milliseconds|Seconds|Minutes|Hours|Month|FullYear|Date)|
2567 Time|Hotkeys|Cursor|ZOptions|Active|Resizable|RequestHeader)|search|slice|
2568 savePreferences|small|home|handleEvent|navigate|char|charCodeAt|charAt|concat|
2569 contextual|confirm|compile|clear|captureEvents|call|createStyleSheet|createPopup|
2570 createEventObject|to(?:GMTString|UTCString|String|Source|UpperCase|LowerCase|LocaleString)|
2571 test|taint|taintEnabled|indexOf|italics|disableExternalCapture|dump|detachEvent|unshift|
2572 untaint|unwatch|updateCommands|join|javaEnabled|pop|push|plugins.refresh|paddings|parse|
2573 print|prompt|preference|enableExternalCapture|exec|execScript|valueOf|UTC|find|file|
2574 fileModifiedDate|fileSize|fileCreatedDate|fileUpdatedDate|fixed|fontsize|fontcolor|
2575 forward|fromCharCode|watch|link|load|lastIndexOf|anchor|attachEvent|atob|apply|alert|
2576 abort|routeEvents|resize|resizeBy|resizeTo|recalc|returnValue|replace|reverse|reload|
2577 releaseCapture|releaseEvents|go|get(?:Milliseconds|Seconds|Minutes|Hours|Month|Day|Year|FullYear|
2578 Time|Date|TimezoneOffset|UTC(?:Milliseconds|Seconds|Minutes|Hours|Day|Month|FullYear|Date)|
2579 Attention|Selection|ResponseHeader|AllResponseHeaders)|moveBy|moveBelow|moveTo|
2580 moveToAbsolute|moveAbove|mergeAttributes|match|margins|btoa|big|bold|borderWidths|blink|back
2581 ) |
2582 (acceptNode|add|addEventListener|addTextTrack|adoptNode|after|animate|append|
2583 appendChild|appendData|before|blur|canPlayType|captureStream|
2584 caretPositionFromPoint|caretRangeFromPoint|checkValidity|clear|click|
2585 cloneContents|cloneNode|cloneRange|close|closest|collapse|
2586 compareBoundaryPoints|compareDocumentPosition|comparePoint|contains|
2587 convertPointFromNode|convertQuadFromNode|convertRectFromNode|createAttribute|
2588 createAttributeNS|createCaption|createCDATASection|createComment|
2589 createContextualFragment|createDocument|createDocumentFragment|
2590 createDocumentType|createElement|createElementNS|createEntityReference|
2591 createEvent|createExpression|createHTMLDocument|createNodeIterator|
2592 createNSResolver|createProcessingInstruction|createRange|createShadowRoot|
2593 createTBody|createTextNode|createTFoot|createTHead|createTreeWalker|delete|
2594 deleteCaption|deleteCell|deleteContents|deleteData|deleteRow|deleteTFoot|
2595 deleteTHead|detach|disconnect|dispatchEvent|elementFromPoint|elementsFromPoint|
2596 enableStyleSheetsForSet|entries|evaluate|execCommand|exitFullscreen|
2597 exitPointerLock|expand|extractContents|fastSeek|firstChild|focus|forEach|get|
2598 getAll|getAnimations|getAttribute|getAttributeNames|getAttributeNode|
2599 getAttributeNodeNS|getAttributeNS|getBoundingClientRect|getBoxQuads|
2600 getClientRects|getContext|getDestinationInsertionPoints|getElementById|
2601 getElementsByClassName|getElementsByName|getElementsByTagName|
2602 getElementsByTagNameNS|getItem|getNamedItem|getSelection|getStartDate|
2603 getVideoPlaybackQuality|has|hasAttribute|hasAttributeNS|hasAttributes|
2604 hasChildNodes|hasFeature|hasFocus|importNode|initEvent|insertAdjacentElement|
2605 insertAdjacentHTML|insertAdjacentText|insertBefore|insertCell|insertData|
2606 insertNode|insertRow|intersectsNode|isDefaultNamespace|isEqualNode|
2607 isPointInRange|isSameNode|item|key|keys|lastChild|load|lookupNamespaceURI|
2608 lookupPrefix|matches|move|moveAttribute|moveAttributeNode|moveChild|
2609 moveNamedItem|namedItem|nextNode|nextSibling|normalize|observe|open|
2610 parentNode|pause|play|postMessage|prepend|preventDefault|previousNode|
2611 previousSibling|probablySupportsContext|queryCommandEnabled|
2612 queryCommandIndeterm|queryCommandState|queryCommandSupported|queryCommandValue|
2613 querySelector|querySelectorAll|registerContentHandler|registerElement|
2614 registerProtocolHandler|releaseCapture|releaseEvents|remove|removeAttribute|
2615 removeAttributeNode|removeAttributeNS|removeChild|removeEventListener|
2616 removeItem|replace|replaceChild|replaceData|replaceWith|reportValidity|
2617 requestFullscreen|requestPointerLock|reset|scroll|scrollBy|scrollIntoView|
2618 scrollTo|seekToNextFrame|select|selectNode|selectNodeContents|set|setAttribute|
2619 setAttributeNode|setAttributeNodeNS|setAttributeNS|setCapture|
2620 setCustomValidity|setEnd|setEndAfter|setEndBefore|setItem|setNamedItem|
2621 setRangeText|setSelectionRange|setSinkId|setStart|setStartAfter|setStartBefore|
2622 slice|splitText|stepDown|stepUp|stopImmediatePropagation|stopPropagation|
2623 submit|substringData|supports|surroundContents|takeRecords|terminate|toBlob|
2624 toDataURL|toggle|toString|values|write|writeln
2625 ) |
2626 (all|catch|finally|race|reject|resolve|then
2628 )(?=\s*\()
2629 captures:
2630 1: punctuation.accessor.ts
2631 2: punctuation.accessor.optional.ts
2632 3: support.function.event-handler.ts
2633 4: support.function.ts
2634 5: support.function.dom.ts
2635 6: support.function.promise.ts
2636 switch-statement:
2637 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?=\bswitch\s*\()'
2638 push:
2639 - meta_scope: switch-statement.expr.ts
2640 - match: '\}'
2641 captures:
2642 0: punctuation.definition.block.ts
2643 pop: true
2644 - include: comment
2645 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(switch)\s*(\()'
2646 captures:
2647 1: keyword.control.switch.ts
2648 2: meta.brace.round.ts
2649 push:
2650 - meta_scope: switch-expression.expr.ts
2651 - match: \)
2652 captures:
2653 0: meta.brace.round.ts
2654 pop: true
2655 - include: expression
2656 - match: '\{'
2657 captures:
2658 0: punctuation.definition.block.ts
2659 push:
2660 - meta_scope: switch-block.expr.ts
2661 - match: '(?=\})'
2662 pop: true
2663 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(case|default(?=:))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2664 captures:
2665 1: keyword.control.switch.ts
2666 push:
2667 - meta_scope: case-clause.expr.ts
2668 - match: (?=:)
2669 pop: true
2670 - include: expression
2671 - match: '(:)\s*(\{)'
2672 captures:
2673 1: case-clause.expr.ts punctuation.definition.section.case-statement.ts
2674 2: meta.block.ts punctuation.definition.block.ts
2675 push:
2676 - meta_content_scope: meta.block.ts
2677 - match: '\}'
2678 captures:
2679 0: meta.block.ts punctuation.definition.block.ts
2680 pop: true
2681 - include: statements
2682 - match: (:)
2683 captures:
2684 0: case-clause.expr.ts punctuation.definition.section.case-statement.ts
2685 - include: statements
2686 template:
2687 - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`)'
2688 push:
2689 - meta_scope: string.template.ts
2690 - match: (?=`)
2691 pop: true
2692 - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))'
2693 push:
2694 - match: '(?=(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`)'
2695 pop: true
2696 - include: support-function-call-identifiers
2697 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
2698 scope: entity.name.function.tagged-template.ts
2699 - include: type-arguments
2700 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?=(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)`)'
2701 captures:
2702 1: entity.name.function.tagged-template.ts
2703 push:
2704 - meta_scope: string.template.ts
2705 - match: (?=`)
2706 pop: true
2707 - include: type-arguments
2708 - match: "([_$[:alpha:]][_$[:alnum:]]*)?(`)"
2709 captures:
2710 1: entity.name.function.tagged-template.ts
2711 2: punctuation.definition.string.template.begin.ts
2712 push:
2713 - meta_scope: string.template.ts
2714 - match: "`"
2715 captures:
2716 0: punctuation.definition.string.template.end.ts
2717 pop: true
2718 - include: template-substitution-element
2719 - include: string-character-escape
2720 template-substitution-element:
2721 - match: '\$\{'
2722 captures:
2723 0: punctuation.definition.template-expression.begin.ts
2724 push:
2725 - meta_scope: meta.template.expression.ts
2726 - meta_content_scope: meta.embedded.line.ts
2727 - match: '\}'
2728 captures:
2729 0: punctuation.definition.template-expression.end.ts
2730 pop: true
2731 - include: expression
2732 ternary-expression:
2733 - match: '(?!\?\.\s*[^[:digit:]])(\?)(?!\?)'
2734 captures:
2735 1: keyword.operator.ternary.ts
2736 push:
2737 - match: \s*(:)
2738 captures:
2739 1: keyword.operator.ternary.ts
2740 pop: true
2741 - include: expression
2742 this-literal:
2743 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))this\b(?!\$)'
2744 scope: variable.language.this.ts
2745 type:
2746 - include: comment
2747 - include: string
2748 - include: numeric-literal
2749 - include: type-primitive
2750 - include: type-builtin-literals
2751 - include: type-parameters
2752 - include: type-tuple
2753 - include: type-object
2754 - include: type-conditional
2755 - include: type-operators
2756 - include: type-fn-type-parameters
2757 - include: type-paren-or-function-parameters
2758 - include: type-function-return-type
2759 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(readonly)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
2760 captures:
2761 1: storage.modifier.ts
2762 - include: type-name
2763 type-alias-declaration:
2764 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(type)\b\s+([_$[:alpha:]][_$[:alnum:]]*)\s*'
2765 captures:
2766 1: keyword.control.export.ts
2767 2: storage.modifier.ts
2768 3: storage.type.type.ts
2769 4: entity.name.type.alias.ts
2770 push:
2771 - meta_scope: meta.type.declaration.ts
2772 - match: '(?=\}|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
2773 pop: true
2774 - include: comment
2775 - include: type-parameters
2776 - match: (=)\s*
2777 captures:
2778 1: keyword.operator.assignment.ts
2779 push:
2780 - match: '(?=\}|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
2781 pop: true
2782 - include: type
2783 type-annotation:
2784 - match: (:)(?=\s*\S)
2785 captures:
2786 1: keyword.operator.type.annotation.ts
2787 push:
2788 - meta_scope: meta.type.annotation.ts
2789 - match: '(?<![:|&])((?=$|^|[,);\}\]]|//)|(?==[^>])|((?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)))'
2790 pop: true
2791 - include: type
2792 - match: (:)
2793 captures:
2794 1: keyword.operator.type.annotation.ts
2795 push:
2796 - meta_scope: meta.type.annotation.ts
2797 - match: '(?<![:|&])((?=[,);\}\]]|//)|(?==[^>])|(?=^\s*$)|((?<=\S)(?=\s*$))|((?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)))'
2798 pop: true
2799 - include: type
2800 type-arguments:
2801 - match: \<
2802 captures:
2803 0: punctuation.definition.typeparameters.begin.ts
2804 push:
2805 - meta_scope: meta.type.parameters.ts
2806 - match: \>
2807 captures:
2808 0: punctuation.definition.typeparameters.end.ts
2809 pop: true
2810 - include: type-arguments-body
2811 type-arguments-body:
2812 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(_)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2813 captures:
2814 0: keyword.operator.type.ts
2815 - include: type
2816 - include: punctuation-comma
2817 type-builtin-literals:
2818 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(this|true|false|undefined|null|object)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2819 scope: support.type.builtin.ts
2820 type-conditional:
2821 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(extends)\s+'
2822 captures:
2823 1: storage.modifier.ts
2824 push:
2825 - match: (?<=:)
2826 pop: true
2827 - match: \?
2828 captures:
2829 0: keyword.operator.ternary.ts
2830 push:
2831 - match: ":"
2832 captures:
2833 0: keyword.operator.ternary.ts
2834 pop: true
2835 - include: type
2836 - include: type
2837 type-fn-type-parameters:
2838 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\b(?=\s*\<)'
2839 captures:
2840 1: meta.type.constructor.ts keyword.control.new.ts
2841 push:
2842 - match: (?<=>)
2843 pop: true
2844 - include: comment
2845 - include: type-parameters
2846 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\b\s*(?=\()'
2847 captures:
2848 1: keyword.control.new.ts
2849 push:
2850 - meta_scope: meta.type.constructor.ts
2851 - match: (?<=\))
2852 pop: true
2853 - include: function-parameters
2854 - match: |-
2855 (?x)(
2856 (?=
2857 [(]\s*(
2858 ([)]) |
2859 (\.\.\.) |
2860 ([_$[:alnum:]]+\s*(
2861 ([:,?=])|
2862 ([)]\s*=>)
2863 ))
2867 push:
2868 - meta_scope: meta.type.function.ts
2869 - match: (?<=\))
2870 pop: true
2871 - include: function-parameters
2872 type-function-return-type:
2873 - match: (=>)(?=\s*\S)
2874 captures:
2875 1: storage.type.function.arrow.ts
2876 push:
2877 - meta_scope: meta.type.function.return.ts
2878 - match: '(?<!=>)(?<![|&])(?=[,\]\)\{\}=;>:\?]|//|$)'
2879 pop: true
2880 - include: type-function-return-type-core
2881 - match: "=>"
2882 captures:
2883 0: storage.type.function.arrow.ts
2884 push:
2885 - meta_scope: meta.type.function.return.ts
2886 - match: '(?<!=>)(?<![|&])((?=[,\]\)\{\}=;:\?>]|//|^\s*$)|((?<=\S)(?=\s*$)))'
2887 pop: true
2888 - include: type-function-return-type-core
2889 type-function-return-type-core:
2890 - include: comment
2891 - match: '(?<==>)(?=\s*\{)'
2892 push:
2893 - match: '(?<=\})'
2894 pop: true
2895 - include: type-object
2896 - include: type-predicate-operator
2897 - include: type
2898 type-name:
2899 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(<)'
2900 captures:
2901 1: entity.name.type.module.ts
2902 2: punctuation.accessor.ts
2903 3: punctuation.accessor.optional.ts
2904 4: meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
2905 push:
2906 - meta_content_scope: meta.type.parameters.ts
2907 - match: (>)
2908 captures:
2909 1: meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
2910 pop: true
2911 - include: type-arguments-body
2912 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(<)'
2913 captures:
2914 1: entity.name.type.ts
2915 2: meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
2916 push:
2917 - meta_content_scope: meta.type.parameters.ts
2918 - match: (>)
2919 captures:
2920 1: meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
2921 pop: true
2922 - include: type-arguments-body
2923 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))'
2924 captures:
2925 1: entity.name.type.module.ts
2926 2: punctuation.accessor.ts
2927 3: punctuation.accessor.optional.ts
2928 - match: "[_$[:alpha:]][_$[:alnum:]]*"
2929 scope: entity.name.type.ts
2930 type-object:
2931 - match: '\{'
2932 captures:
2933 0: punctuation.definition.block.ts
2934 push:
2935 - meta_scope: meta.object.type.ts
2936 - match: '\}'
2937 captures:
2938 0: punctuation.definition.block.ts
2939 pop: true
2940 - include: comment
2941 - include: method-declaration
2942 - include: indexer-declaration
2943 - include: indexer-mapped-type-declaration
2944 - include: field-declaration
2945 - include: type-annotation
2946 - match: \.\.\.
2947 captures:
2948 0: keyword.operator.spread.ts
2949 push:
2950 - match: '(?=\}|;|,|$)|(?<=\})'
2951 pop: true
2952 - include: type
2953 - include: punctuation-comma
2954 - include: punctuation-semicolon
2955 - include: type
2956 type-operators:
2957 - include: typeof-operator
2958 - match: '([&|])(?=\s*\{)'
2959 captures:
2960 0: keyword.operator.type.ts
2961 push:
2962 - match: '(?<=\})'
2963 pop: true
2964 - include: type-object
2965 - match: "[&|]"
2966 captures:
2967 0: keyword.operator.type.ts
2968 push:
2969 - match: (?=\S)
2970 pop: true
2971 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))keyof(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2972 scope: keyword.operator.expression.keyof.ts
2973 - match: (\?|\:)
2974 scope: keyword.operator.ternary.ts
2975 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))infer(?=\s+[_$[:alpha:]])'
2976 scope: keyword.operator.expression.infer.ts
2977 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))import(?=\s*\()'
2978 scope: keyword.operator.expression.import.ts
2979 type-parameters:
2980 - match: (<)
2981 captures:
2982 1: punctuation.definition.typeparameters.begin.ts
2983 push:
2984 - meta_scope: meta.type.parameters.ts
2985 - match: (>)
2986 captures:
2987 1: punctuation.definition.typeparameters.end.ts
2988 pop: true
2989 - include: comment
2990 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(extends)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2991 scope: storage.modifier.ts
2992 - include: type
2993 - include: punctuation-comma
2994 - match: (=)(?!>)
2995 scope: keyword.operator.assignment.ts
2996 type-paren-or-function-parameters:
2997 - match: \(
2998 captures:
2999 0: meta.brace.round.ts
3000 push:
3001 - meta_scope: meta.type.paren.cover.ts
3002 - match: \)
3003 captures:
3004 0: meta.brace.round.ts
3005 pop: true
3006 - match: |-
3007 (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s*(\??)(?=\s*(:\s*(
3008 (<) |
3009 ([(]\s*(
3010 ([)]) |
3011 (\.\.\.) |
3012 ([_$[:alnum:]]+\s*(
3013 ([:,?=])|
3014 ([)]\s*=>)
3015 ))
3016 ))
3017 )) |
3018 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
3019 (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))))
3020 captures:
3021 1: storage.modifier.ts
3022 2: keyword.operator.rest.ts
3023 3: entity.name.function.ts variable.language.this.ts
3024 4: entity.name.function.ts
3025 5: keyword.operator.optional.ts
3026 - match: '(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s*(\??)(?=:)'
3027 captures:
3028 1: storage.modifier.ts
3029 2: keyword.operator.rest.ts
3030 3: variable.parameter.ts variable.language.this.ts
3031 4: variable.parameter.ts
3032 5: keyword.operator.optional.ts
3033 - include: type-annotation
3034 - match: ","
3035 scope: punctuation.separator.parameter.ts
3036 - include: type
3037 type-predicate-operator:
3038 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(asserts)\s+)?(?!asserts)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s(is)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3039 captures:
3040 1: keyword.operator.type.asserts.ts
3041 2: variable.parameter.ts variable.language.this.ts
3042 3: variable.parameter.ts
3043 4: keyword.operator.expression.is.ts
3044 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(asserts)\s+(?!is)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3045 captures:
3046 1: keyword.operator.type.asserts.ts
3047 2: variable.parameter.ts variable.language.this.ts
3048 3: variable.parameter.ts
3049 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))asserts(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3050 scope: keyword.operator.type.asserts.ts
3051 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))is(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3052 scope: keyword.operator.expression.is.ts
3053 type-primitive:
3054 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(string|number|bigint|boolean|symbol|any|void|never|unknown)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3055 scope: support.type.primitive.ts
3056 type-tuple:
3057 - match: '\['
3058 captures:
3059 0: meta.brace.square.ts
3060 push:
3061 - meta_scope: meta.type.tuple.ts
3062 - match: '\]'
3063 captures:
3064 0: meta.brace.square.ts
3065 pop: true
3066 - include: type
3067 - include: punctuation-comma
3068 typeof-operator:
3069 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))typeof(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3070 scope: keyword.operator.expression.typeof.ts
3071 undefined-literal:
3072 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))undefined(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3073 scope: constant.language.undefined.ts
3074 var-expr:
3075 - match: '(?=(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))'
3076 push:
3077 - meta_scope: meta.var.expr.ts
3078 - 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*$)))'
3079 pop: true
3080 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
3081 captures:
3082 1: keyword.control.export.ts
3083 2: storage.modifier.ts
3084 3: storage.type.ts
3085 push:
3086 - match: (?=\S)
3087 pop: true
3088 - include: destructuring-variable
3089 - include: var-single-variable
3090 - include: variable-initializer
3091 - include: comment
3092 - match: (,)\s*((?!\S)|(?=\/\/))
3093 captures:
3094 1: punctuation.separator.comma.ts
3095 push:
3096 - match: '(?<!,)(((?==|;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|^\s*$))|((?<=\S)(?=\s*$)))'
3097 pop: true
3098 - include: single-line-comment-consuming-line-ending
3099 - include: comment
3100 - include: destructuring-variable
3101 - include: var-single-variable
3102 - include: punctuation-comma
3103 - include: punctuation-comma
3104 - match: '(?=(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))'
3105 captures:
3106 1: keyword.control.export.ts
3107 2: storage.modifier.ts
3108 3: storage.type.ts
3109 push:
3110 - meta_scope: meta.var.expr.ts
3111 - 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*$)))'
3112 pop: true
3113 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
3114 captures:
3115 1: keyword.control.export.ts
3116 2: storage.modifier.ts
3117 3: storage.type.ts
3118 push:
3119 - match: (?=\S)
3120 pop: true
3121 - include: destructuring-const
3122 - include: var-single-const
3123 - include: variable-initializer
3124 - include: comment
3125 - match: (,)\s*((?!\S)|(?=\/\/))
3126 captures:
3127 1: punctuation.separator.comma.ts
3128 push:
3129 - match: '(?<!,)(((?==|;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|^\s*$))|((?<=\S)(?=\s*$)))'
3130 pop: true
3131 - include: single-line-comment-consuming-line-ending
3132 - include: comment
3133 - include: destructuring-const
3134 - include: var-single-const
3135 - include: punctuation-comma
3136 - include: punctuation-comma
3137 var-single-const:
3138 - match: |-
3139 (?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\s*
3140 # function assignment |
3141 (=\s*(
3142 ((async\s+)?(
3143 (function\s*[(<*]) |
3144 (function\s+) |
3145 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3146 )) |
3147 ((async\s*)?(
3148 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3149 # sure shot arrow functions even if => is on new line
3151 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3152 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3154 ([)]\s*:) | # ():
3155 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3157 ) |
3159 # arrow function possible to detect only with => on same line
3161 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3162 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3163 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3164 \s*=> # arrow operator
3166 ))
3167 )) |
3168 # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
3169 (:\s*(
3170 (<) |
3171 ([(]\s*(
3172 ([)]) |
3173 (\.\.\.) |
3174 ([_$[:alnum:]]+\s*(
3175 ([:,?=])|
3176 ([)]\s*=>)
3177 ))
3178 ))
3179 )) |
3180 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
3181 (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
3182 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
3183 ((async\s+)?(
3184 (function\s*[(<*]) |
3185 (function\s+) |
3186 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3187 )) |
3188 ((async\s*)?(
3189 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3190 # sure shot arrow functions even if => is on new line
3192 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3193 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3195 ([)]\s*:) | # ():
3196 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3198 ) |
3200 # arrow function possible to detect only with => on same line
3202 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3203 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3204 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3205 \s*=> # arrow operator
3207 ))
3208 )))
3209 captures:
3210 1: meta.definition.variable.ts variable.other.constant.ts entity.name.function.ts
3211 push:
3212 - meta_scope: meta.var-single-variable.expr.ts
3213 - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3214 pop: true
3215 - include: var-single-variable-type-annotation
3216 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
3217 captures:
3218 1: meta.definition.variable.ts variable.other.constant.ts
3219 push:
3220 - meta_scope: meta.var-single-variable.expr.ts
3221 - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3222 pop: true
3223 - include: var-single-variable-type-annotation
3224 var-single-variable:
3225 - match: |-
3226 (?x)([_$[:alpha:]][_$[:alnum:]]*)(\!)?(?=\s*
3227 # function assignment |
3228 (=\s*(
3229 ((async\s+)?(
3230 (function\s*[(<*]) |
3231 (function\s+) |
3232 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3233 )) |
3234 ((async\s*)?(
3235 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3236 # sure shot arrow functions even if => is on new line
3238 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3239 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3241 ([)]\s*:) | # ():
3242 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3244 ) |
3246 # arrow function possible to detect only with => on same line
3248 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3249 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3250 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3251 \s*=> # arrow operator
3253 ))
3254 )) |
3255 # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
3256 (:\s*(
3257 (<) |
3258 ([(]\s*(
3259 ([)]) |
3260 (\.\.\.) |
3261 ([_$[:alnum:]]+\s*(
3262 ([:,?=])|
3263 ([)]\s*=>)
3264 ))
3265 ))
3266 )) |
3267 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
3268 (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
3269 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
3270 ((async\s+)?(
3271 (function\s*[(<*]) |
3272 (function\s+) |
3273 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3274 )) |
3275 ((async\s*)?(
3276 ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3277 # sure shot arrow functions even if => is on new line
3279 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3280 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3282 ([)]\s*:) | # ():
3283 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3285 ) |
3287 # arrow function possible to detect only with => on same line
3289 (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3290 \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3291 (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3292 \s*=> # arrow operator
3294 ))
3295 )))
3296 captures:
3297 1: meta.definition.variable.ts entity.name.function.ts
3298 2: keyword.operator.definiteassignment.ts
3299 push:
3300 - meta_scope: meta.var-single-variable.expr.ts
3301 - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3302 pop: true
3303 - include: var-single-variable-type-annotation
3304 - match: '([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])(\!)?'
3305 captures:
3306 1: meta.definition.variable.ts variable.other.constant.ts
3307 2: keyword.operator.definiteassignment.ts
3308 push:
3309 - meta_scope: meta.var-single-variable.expr.ts
3310 - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3311 pop: true
3312 - include: var-single-variable-type-annotation
3313 - match: '([_$[:alpha:]][_$[:alnum:]]*)(\!)?'
3314 captures:
3315 1: meta.definition.variable.ts variable.other.readwrite.ts
3316 2: keyword.operator.definiteassignment.ts
3317 push:
3318 - meta_scope: meta.var-single-variable.expr.ts
3319 - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3320 pop: true
3321 - include: var-single-variable-type-annotation
3322 var-single-variable-type-annotation:
3323 - include: type-annotation
3324 - include: string
3325 - include: comment
3326 variable-initializer:
3327 - match: (?<!=|!)(=)(?!=)(?=\s*\S)(?!\s*.*=>\s*$)
3328 captures:
3329 1: keyword.operator.assignment.ts
3330 push:
3331 - match: '(?=$|^|[,);}\]]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3332 pop: true
3333 - include: expression
3334 - match: (?<!=|!)(=)(?!=)
3335 captures:
3336 1: keyword.operator.assignment.ts
3337 push:
3338 - match: '(?=[,);}\]]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))|(?=^\s*$)|(?<=\S)(?<!=)(?=\s*$)'
3339 pop: true
3340 - include: expression