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