on master help sign in
Manually convert TypeScript.sublime-syntax
f4a59d7sharkdp
assets/syntaxes/TypeScript.sublime-syntax+727−439
@@ -44,7 +44,7 @@ contexts:
44 5: punctuation.decorator.internaldeclaration.ts
44 5: punctuation.decorator.internaldeclaration.ts
45 push:
45 push:
46 - meta_content_scope: comment.line.double-slash.ts
46 - meta_content_scope: comment.line.double-slash.ts
47− - match: (?=^)
47+ - match: (?=$)
48 pop: true
48 pop: true
49 access-modifier:
49 access-modifier:
50 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(abstract|public|protected|private|readonly|static)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
50 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(abstract|public|protected|private|readonly|static)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
@@ -109,21 +109,19 @@ contexts:
109 (?=
109 (?=
110 # sure shot arrow functions even if => is on new line
110 # sure shot arrow functions even if => is on new line
111 (
111 (
112− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
112+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
113− [(]\s*
113+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
114 (
114 (
115 ([)]\s*:) | # ():
115 ([)]\s*:) | # ():
116 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
116 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
117 )
117 )
118 ) |
118 ) |
119− (
119+
120− [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
121− ) |
122 # arrow function possible to detect only with => on same line
120 # arrow function possible to detect only with => on same line
123 (
121 (
124− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
122+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
125− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
123+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
126− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
124+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
127 \s*=> # arrow operator
125 \s*=> # arrow operator
128 )
126 )
129 )
127 )
@@ -138,13 +136,15 @@ contexts:
138 - include: type-parameters
136 - include: type-parameters
139 - include: function-parameters
137 - include: function-parameters
140 - include: arrow-return-type
138 - include: arrow-return-type
139+ - include: possibly-arrow-return-type
141 - match: "=>"
140 - match: "=>"
142 captures:
141 captures:
143 0: storage.type.function.arrow.ts
142 0: storage.type.function.arrow.ts
144 push:
143 push:
145 - meta_scope: meta.arrow.ts
144 - meta_scope: meta.arrow.ts
146− - match: '(?<=\}|\S)(?<!=>)|((?!\{)(?=\S))'
145+ - match: '((?<=\}|\S)(?<!=>)|((?!\{)(?=\S)))(?!\/[\/\*])'
147 pop: true
146 pop: true
147+ - include: single-line-comment-consuming-line-ending
148 - include: decl-block
148 - include: decl-block
149 - include: expression
149 - include: expression
150 arrow-return-type:
150 arrow-return-type:
@@ -170,6 +170,8 @@ contexts:
170 binding-element:
170 binding-element:
171 - include: comment
171 - include: comment
172 - include: string
172 - include: string
173+ - include: numeric-literal
174+ - include: regex
173 - include: object-binding-pattern
175 - include: object-binding-pattern
174 - include: array-binding-pattern
176 - include: array-binding-pattern
175 - include: destructuring-variable-rest
177 - include: destructuring-variable-rest
@@ -177,6 +179,8 @@ contexts:
177 binding-element-const:
179 binding-element-const:
178 - include: comment
180 - include: comment
179 - include: string
181 - include: string
182+ - include: numeric-literal
183+ - include: regex
180 - include: object-binding-pattern-const
184 - include: object-binding-pattern-const
181 - include: array-binding-pattern-const
185 - include: array-binding-pattern-const
182 - include: destructuring-variable-rest-const
186 - include: destructuring-variable-rest-const
@@ -198,12 +202,18 @@ contexts:
198 pop: true
202 pop: true
199 - include: brackets
203 - include: brackets
200 cast:
204 cast:
205+ - match: \s*(<)\s*(const)\s*(>)
206+ scope: cast.expr.ts
207+ captures:
208+ 1: meta.brace.angle.ts
209+ 2: storage.modifier.ts
210+ 3: meta.brace.angle.ts
201 - match: '(?:(?<!\+\+|--)(?<=^return|[^\._$[:alnum:]]return|^throw|[^\._$[:alnum:]]throw|^yield|[^\._$[:alnum:]]yield|^await|[^\._$[:alnum:]]await|^default|[^\._$[:alnum:]]default|[=(,:>*?\&\|\^]|[^_$[:alnum:]](?:\+\+|\-\-)|[^\+]\+|[^\-]\-))\s*(<)(?!<?\=)(?!\s*$)'
211 - match: '(?:(?<!\+\+|--)(?<=^return|[^\._$[:alnum:]]return|^throw|[^\._$[:alnum:]]throw|^yield|[^\._$[:alnum:]]yield|^await|[^\._$[:alnum:]]await|^default|[^\._$[:alnum:]]default|[=(,:>*?\&\|\^]|[^_$[:alnum:]](?:\+\+|\-\-)|[^\+]\+|[^\-]\-))\s*(<)(?!<?\=)(?!\s*$)'
202 captures:
212 captures:
203 1: meta.brace.angle.ts
213 1: meta.brace.angle.ts
204 push:
214 push:
205 - meta_scope: cast.expr.ts
215 - meta_scope: cast.expr.ts
206− - match: (\>)\s*
216+ - match: (\>)
207 captures:
217 captures:
208 1: meta.brace.angle.ts
218 1: meta.brace.angle.ts
209 pop: true
219 pop: true
@@ -213,17 +223,18 @@ contexts:
213 1: meta.brace.angle.ts
223 1: meta.brace.angle.ts
214 push:
224 push:
215 - meta_scope: cast.expr.ts
225 - meta_scope: cast.expr.ts
216− - match: (\>)\s*
226+ - match: (\>)
217 captures:
227 captures:
218 1: meta.brace.angle.ts
228 1: meta.brace.angle.ts
219 pop: true
229 pop: true
220 - include: type
230 - include: type
221 class-declaration:
231 class-declaration:
222− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(export)\s+)?\b(?:(abstract)\s+)?\b(class)\b(?=\s+|/[/*])'
232+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(?:(abstract)\s+)?\b(class)\b(?=\s+|/[/*])'
223 captures:
233 captures:
224 1: keyword.control.export.ts
234 1: keyword.control.export.ts
225 2: storage.modifier.ts
235 2: storage.modifier.ts
236+ 3: storage.modifier.ts
226− 3: storage.type.class.ts
237+ 4: storage.type.class.ts
227 push:
238 push:
228 - meta_scope: meta.class.ts
239 - meta_scope: meta.class.ts
229 - match: '(?<=\})'
240 - match: '(?<=\})'
@@ -238,9 +249,10 @@ contexts:
238 - include: type-parameters
249 - include: type-parameters
239 - include: class-or-interface-body
250 - include: class-or-interface-body
240 class-expression:
251 class-expression:
241− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(class)\b(?=\s+|[<{]|\/[\/*])'
252+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(abstract)\s+)?(class)\b(?=\s+|[<{]|\/[\/*])'
242 captures:
253 captures:
254+ 1: storage.modifier.ts
243− 1: storage.type.class.ts
255+ 2: storage.type.class.ts
244 push:
256 push:
245 - meta_scope: meta.class.ts
257 - meta_scope: meta.class.ts
246 - match: '(?<=\})'
258 - match: '(?<=\})'
@@ -257,6 +269,11 @@ contexts:
257 pop: true
269 pop: true
258 - include: comment
270 - include: comment
259 - include: decorator
271 - include: decorator
272+ - match: (?<=:)\s*
273+ push:
274+ - match: '(?=\s|[;),}\]:\-\+]|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
275+ pop: true
276+ - include: expression
260 - include: method-declaration
277 - include: method-declaration
261 - include: indexer-declaration
278 - include: indexer-declaration
262 - include: field-declaration
279 - include: field-declaration
@@ -306,6 +323,7 @@ contexts:
306 scope: keyword.control.flow.ts
323 scope: keyword.control.flow.ts
307 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(case|default|switch)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
324 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(case|default|switch)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
308 scope: keyword.control.switch.ts
325 scope: keyword.control.switch.ts
326+ - include: if-statement
309 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(else|if)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
327 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(else|if)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
310 scope: keyword.control.conditional.ts
328 scope: keyword.control.conditional.ts
311 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(with)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
329 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(with)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
@@ -314,8 +332,6 @@ contexts:
314 scope: keyword.control.ts
332 scope: keyword.control.ts
315 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(debugger)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
333 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(debugger)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
316 scope: keyword.other.debugger.ts
334 scope: keyword.other.debugger.ts
317− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(declare)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
318− scope: storage.modifier.ts
319 decl-block:
335 decl-block:
320 - match: '\{'
336 - match: '\{'
321 captures:
337 captures:
@@ -339,6 +355,8 @@ contexts:
339 - include: import-equals-declaration
355 - include: import-equals-declaration
340 - include: import-declaration
356 - include: import-declaration
341 - include: export-declaration
357 - include: export-declaration
358+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(declare|export)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
359+ scope: storage.modifier.ts
342 decorator:
360 decorator:
343 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))\@'
361 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))\@'
344 captures:
362 captures:
@@ -352,7 +370,7 @@ contexts:
352 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\{)'
370 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\{)'
353 push:
371 push:
354 - meta_scope: meta.object-binding-pattern-variable.ts
372 - meta_scope: meta.object-binding-pattern-variable.ts
355− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
373+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
356 pop: true
374 pop: true
357 - include: object-binding-pattern-const
375 - include: object-binding-pattern-const
358 - include: type-annotation
376 - include: type-annotation
@@ -360,15 +378,16 @@ contexts:
360 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\[)'
378 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\[)'
361 push:
379 push:
362 - meta_scope: meta.array-binding-pattern-variable.ts
380 - meta_scope: meta.array-binding-pattern-variable.ts
363− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
381+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
364 pop: true
382 pop: true
365 - include: array-binding-pattern-const
383 - include: array-binding-pattern-const
366 - include: type-annotation
384 - include: type-annotation
367 - include: comment
385 - include: comment
368 destructuring-parameter:
386 destructuring-parameter:
369− - match: '(?<!=|:)\s*(\{)'
387+ - match: '(?<!=|:)\s*(?:(\.\.\.)\s*)?(\{)'
370 captures:
388 captures:
389+ 1: keyword.operator.rest.ts
371− 1: punctuation.definition.binding-pattern.object.ts
390+ 2: punctuation.definition.binding-pattern.object.ts
372 push:
391 push:
373 - meta_scope: meta.parameter.object-binding-pattern.ts
392 - meta_scope: meta.parameter.object-binding-pattern.ts
374 - match: '\}'
393 - match: '\}'
@@ -376,9 +395,10 @@ contexts:
376 0: punctuation.definition.binding-pattern.object.ts
395 0: punctuation.definition.binding-pattern.object.ts
377 pop: true
396 pop: true
378 - include: parameter-object-binding-element
397 - include: parameter-object-binding-element
379− - match: '(?<!=|:)\s*(\[)'
398+ - match: '(?<!=|:)\s*(?:(\.\.\.)\s*)?(\[)'
380 captures:
399 captures:
400+ 1: keyword.operator.rest.ts
381− 1: punctuation.definition.binding-pattern.array.ts
401+ 2: punctuation.definition.binding-pattern.array.ts
382 push:
402 push:
383 - meta_scope: meta.paramter.array-binding-pattern.ts
403 - meta_scope: meta.paramter.array-binding-pattern.ts
384 - match: '\]'
404 - match: '\]'
@@ -396,7 +416,7 @@ contexts:
396 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\{)'
416 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\{)'
397 push:
417 push:
398 - meta_scope: meta.object-binding-pattern-variable.ts
418 - meta_scope: meta.object-binding-pattern-variable.ts
399− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
419+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
400 pop: true
420 pop: true
401 - include: object-binding-pattern
421 - include: object-binding-pattern
402 - include: type-annotation
422 - include: type-annotation
@@ -404,7 +424,7 @@ contexts:
404 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\[)'
424 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\[)'
405 push:
425 push:
406 - meta_scope: meta.array-binding-pattern-variable.ts
426 - meta_scope: meta.array-binding-pattern-variable.ts
407− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
427+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
408 pop: true
428 pop: true
409 - include: array-binding-pattern
429 - include: array-binding-pattern
410 - include: type-annotation
430 - include: type-annotation
@@ -420,12 +440,12 @@ contexts:
420 1: keyword.operator.rest.ts
440 1: keyword.operator.rest.ts
421 2: meta.definition.variable.ts variable.other.constant.ts
441 2: meta.definition.variable.ts variable.other.constant.ts
422 directives:
442 directives:
423− - match: '^(///)\s*(?=<(reference|amd-dependency|amd-module)(\s+(path|types|no-default-lib|lib|name)\s*=\s*((\''([^\''\\]|\\\''|\\)*\'')|(\"([^\"\\]|\\\"|\\)*\")))+\s*/>\s*$)'
443+ - match: '^(///)\s*(?=<(reference|amd-dependency|amd-module)(\s+(path|types|no-default-lib|lib|name)\s*=\s*((\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)))+\s*/>\s*$)'
424 captures:
444 captures:
425 1: punctuation.definition.comment.ts
445 1: punctuation.definition.comment.ts
426 push:
446 push:
427 - meta_scope: comment.line.triple-slash.directive.ts
447 - meta_scope: comment.line.triple-slash.directive.ts
428− - match: (?=^)
448+ - match: (?=$)
429 pop: true
449 pop: true
430 - match: (<)(reference|amd-dependency|amd-module)
450 - match: (<)(reference|amd-dependency|amd-module)
431 captures:
451 captures:
@@ -687,13 +707,18 @@ contexts:
687 captures:
707 captures:
688 1: punctuation.definition.block.tag.jsdoc
708 1: punctuation.definition.block.tag.jsdoc
689 - include: inline-tags
709 - include: inline-tags
710+ - match: '((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\s+)'
711+ captures:
712+ 1: storage.type.class.jsdoc
713+ 2: punctuation.definition.block.tag.jsdoc
690 enum-declaration:
714 enum-declaration:
691− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:\b(const)\s+)?\b(enum)\s+([_$[:alpha:]][_$[:alnum:]]*)'
715+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?(?:\b(const)\s+)?\b(enum)\s+([_$[:alpha:]][_$[:alnum:]]*)'
692 captures:
716 captures:
693 1: keyword.control.export.ts
717 1: keyword.control.export.ts
694 2: storage.modifier.ts
718 2: storage.modifier.ts
695− 3: storage.type.enum.ts
719+ 3: storage.modifier.ts
720+ 4: storage.type.enum.ts
696− 4: entity.name.type.enum.ts
721+ 5: entity.name.type.enum.ts
697 push:
722 push:
698 - meta_scope: meta.enum.declaration.ts
723 - meta_scope: meta.enum.declaration.ts
699 - match: '(?<=\})'
724 - match: '(?<=\})'
@@ -716,7 +741,7 @@ contexts:
716 pop: true
741 pop: true
717 - include: comment
742 - include: comment
718 - include: variable-initializer
743 - include: variable-initializer
719− - match: '(?=((\''([^\''\\]|\\\''|\\)*\'')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\])))'
744+ - match: '(?=((\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\])))'
720 push:
745 push:
721 - match: '(?=,|\}|$)'
746 - match: '(?=,|\}|$)'
722 pop: true
747 pop: true
@@ -739,15 +764,16 @@ contexts:
739 3: keyword.control.default.ts
764 3: keyword.control.default.ts
740 push:
765 push:
741 - meta_scope: meta.export.default.ts
766 - meta_scope: meta.export.default.ts
742− - match: (?=$|;|^\s*abstract\b|^\s*async\b|^\s*class\b|^\s*const\b|^\s*declare\b|^\s*enum\b|^\s*export\b|^\s*function\b|^\s*import\b|^\s*interface\b|^\s*let\b|^\s*module\b|^\s*namespace\b|^\s*return\b|^\s*type\b|^\s*var\b)
767+ - match: (?=$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))
743 pop: true
768 pop: true
769+ - include: interface-declaration
744 - include: expression
770 - include: expression
745− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(export)(?!\s*:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
771+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(export)\b(?!(\$)|(\s*:))((?=\s*[\{*])|((?=\s*[_$[:alpha:]][_$[:alnum:]]*(\s|,))(?!\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b)))'
746 captures:
772 captures:
747 0: keyword.control.export.ts
773 0: keyword.control.export.ts
748 push:
774 push:
749 - meta_scope: meta.export.ts
775 - meta_scope: meta.export.ts
750− - match: (?=$|;|^\s*abstract\b|^\s*async\b|^\s*class\b|^\s*const\b|^\s*declare\b|^\s*enum\b|^\s*export\b|^\s*function\b|^\s*import\b|^\s*interface\b|^\s*let\b|^\s*module\b|^\s*namespace\b|^\s*return\b|^\s*type\b|^\s*var\b)
776+ - match: (?=$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))
751 pop: true
777 pop: true
752 - include: import-export-declaration
778 - include: import-export-declaration
753 expression:
779 expression:
@@ -756,7 +782,101 @@ contexts:
756 - include: expressionPunctuations
782 - include: expressionPunctuations
757 expression-inside-possibly-arrow-parens:
783 expression-inside-possibly-arrow-parens:
758 - include: expressionWithoutIdentifiers
784 - include: expressionWithoutIdentifiers
759− - include: function-parameters-body
785+ - include: comment
786+ - include: string
787+ - include: decorator
788+ - include: destructuring-parameter
789+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|protected|private|readonly)\s+(?=(public|protected|private|readonly)\s+)'
790+ captures:
791+ 1: storage.modifier.ts
792+ - match: |-
793+ (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*
794+ # function assignment |
795+ (=\s*(
796+ ((async\s+)?(
797+ (function\s*[(<*]) |
798+ (function\s+) |
799+ ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
800+ )) |
801+ ((async\s*)?(
802+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
803+ # sure shot arrow functions even if => is on new line
804+ (
805+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
806+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
807+ (
808+ ([)]\s*:) | # ():
809+ ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
810+ )
811+ ) |
812+
813+ # arrow function possible to detect only with => on same line
814+ (
815+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
816+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
817+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
818+ \s*=> # arrow operator
819+ )
820+ ))
821+ )) |
822+ # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
823+ (:\s*(
824+ (<) |
825+ ([(]\s*(
826+ ([)]) |
827+ (\.\.\.) |
828+ ([_$[:alnum:]]+\s*(
829+ ([:,?=])|
830+ ([)]\s*=>)
831+ ))
832+ ))
833+ )) |
834+ (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
835+ (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
836+ (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
837+ ((async\s+)?(
838+ (function\s*[(<*]) |
839+ (function\s+) |
840+ ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
841+ )) |
842+ ((async\s*)?(
843+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
844+ # sure shot arrow functions even if => is on new line
845+ (
846+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
847+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
848+ (
849+ ([)]\s*:) | # ():
850+ ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
851+ )
852+ ) |
853+
854+ # arrow function possible to detect only with => on same line
855+ (
856+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
857+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
858+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
859+ \s*=> # arrow operator
860+ )
861+ ))
862+ )))
863+ captures:
864+ 1: storage.modifier.ts
865+ 2: keyword.operator.rest.ts
866+ 3: entity.name.function.ts variable.language.this.ts
867+ 4: entity.name.function.ts
868+ 5: keyword.operator.optional.ts
869+ - match: '(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*:)'
870+ captures:
871+ 1: storage.modifier.ts
872+ 2: keyword.operator.rest.ts
873+ 3: variable.parameter.ts variable.language.this.ts
874+ 4: variable.parameter.ts
875+ 5: keyword.operator.optional.ts
876+ - include: type-annotation
877+ - include: variable-initializer
878+ - match: ","
879+ scope: punctuation.separator.parameter.ts
760 - include: identifiers
880 - include: identifiers
761 - include: expressionPunctuations
881 - include: expressionPunctuations
762 expression-operators:
882 expression-operators:
@@ -788,11 +908,15 @@ contexts:
788 - include: typeof-operator
908 - include: typeof-operator
789 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))void(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
909 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))void(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
790 scope: keyword.operator.expression.void.ts
910 scope: keyword.operator.expression.void.ts
911+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+(const)(?=\s*($|[;,:})\]]))'
912+ captures:
913+ 1: keyword.control.as.ts
914+ 2: storage.modifier.ts
791 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+'
915 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+'
792 captures:
916 captures:
793 1: keyword.control.as.ts
917 1: keyword.control.as.ts
794 push:
918 push:
795− - match: '(?=$|^|[;,:})\]]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+))'
919+ - match: '(?=$|^|[;,:})\]]|\|\||\&\&|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+)|(\s+\<))'
796 pop: true
920 pop: true
797 - include: type
921 - include: type
798 - match: \.\.\.
922 - match: \.\.\.
@@ -807,7 +931,7 @@ contexts:
807 scope: keyword.operator.comparison.ts
931 scope: keyword.operator.comparison.ts
808 - match: <=|>=|<>|<|>
932 - match: <=|>=|<>|<|>
809 scope: keyword.operator.relational.ts
933 scope: keyword.operator.relational.ts
810− - match: \!|&&|\|\|
934+ - match: \!|&&|\|\||\?\?
811 scope: keyword.operator.logical.ts
935 scope: keyword.operator.logical.ts
812 - match: \&|~|\^|\|
936 - match: \&|~|\^|\|
813 scope: keyword.operator.bitwise.ts
937 scope: keyword.operator.bitwise.ts
@@ -819,6 +943,13 @@ contexts:
819 scope: keyword.operator.increment.ts
943 scope: keyword.operator.increment.ts
820 - match: '%|\*|/|-|\+'
944 - match: '%|\*|/|-|\+'
821 scope: keyword.operator.arithmetic.ts
945 scope: keyword.operator.arithmetic.ts
946+ - match: '(?<=[_$[:alnum:])\]])\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)+(/)(?![/*]))'
947+ push:
948+ - match: '(/)(?!\*([^\*]|(\*[^\/]))*\*\/)'
949+ captures:
950+ 1: keyword.operator.arithmetic.ts
951+ pop: true
952+ - include: comment
822 - match: '(?<=[_$[:alnum:])\]])\s*(/)(?![/*])'
953 - match: '(?<=[_$[:alnum:])\]])\s*(/)(?![/*])'
823 captures:
954 captures:
824 1: keyword.operator.arithmetic.ts
955 1: keyword.operator.arithmetic.ts
@@ -828,7 +959,6 @@ contexts:
828 expressionWithoutIdentifiers:
959 expressionWithoutIdentifiers:
829 - include: string
960 - include: string
830 - include: regex
961 - include: regex
831− - include: template
832 - include: comment
962 - include: comment
833 - include: function-expression
963 - include: function-expression
834 - include: class-expression
964 - include: class-expression
@@ -846,143 +976,119 @@ contexts:
846 - include: paren-expression
976 - include: paren-expression
847 field-declaration:
977 field-declaration:
848 - match: |-
978 - match: |-
849− (?x)(?<!\()(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(readonly)\s+)?(?=\s*((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
979+ (?x)(?<!\()(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(readonly)\s+)?(?=\s*((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
850− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
980+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
851− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
981+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
852− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
982+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
853− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
983+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
854− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
984+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
855− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
985+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
856− (?:\B(\.)[0-9][0-9_]*\b)| # .1
986+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
857− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
987+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
858− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))
988+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(?:(?:(\?)|(\!))\s*)?(=|:|;|,|\}|$))
859 captures:
989 captures:
860 1: storage.modifier.ts
990 1: storage.modifier.ts
861 push:
991 push:
862 - meta_scope: meta.field.declaration.ts
992 - meta_scope: meta.field.declaration.ts
863 - match: |-
993 - match: |-
864− (?x)(?=\}|;|,|$|(^(?!\s*((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
994+ (?x)(?=\}|;|,|$|(^(?!\s*((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
865− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
995+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
866− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
996+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
867− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
997+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
868− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
998+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
869− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
999+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
870− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1000+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
871− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1001+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
872− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1002+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
873− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))))|(?<=\})
1003+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(?:(?:(\?)|(\!))\s*)?(=|:|;|,|$))))|(?<=\})
874 pop: true
1004 pop: true
875 - include: variable-initializer
1005 - include: variable-initializer
1006+ - include: type-annotation
1007+ - include: string
1008+ - include: array-literal
1009+ - include: numeric-literal
1010+ - include: comment
876 - match: |-
1011 - match: |-
877− (?x)(?=((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1012+ (?x)([_$[:alpha:]][_$[:alnum:]]*)(?:(\?)|(\!))?(?=\s*\s*
878− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1013+ # function assignment |
879− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1014+ (=\s*(
880− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1015+ ((async\s+)?(
881− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1016+ (function\s*[(<*]) |
882− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1017+ (function\s+) |
883− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1018+ ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
884− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1019+ )) |
885− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1020+ ((async\s*)?(
886− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))
1021+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
887− push:
1022+ # sure shot arrow functions even if => is on new line
888− - match: |-
1023+ (
889− (?x)(?=[};,=]|$|(^(?!\s*((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1024+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
890− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1025+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
891− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1026+ (
892− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1027+ ([)]\s*:) | # ():
893− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1028+ ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
894− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1029+ )
895− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1030+ ) |
896− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1031+
897− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1032+ # arrow function possible to detect only with => on same line
898− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))))|(?<=\})
1033+ (
899− pop: true
1034+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
900− - include: type-annotation
1035+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
901− - include: string
1036+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
902− - include: array-literal
1037+ \s*=> # arrow operator
903− - include: numeric-literal
1038+ )
904− - include: comment
1039+ ))
905− - match: |-
1040+ )) |
906− (?x)([_$[:alpha:]][_$[:alnum:]]*)(\?)?(?=(\?\s*)?\s*
1041+ # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
907− # function assignment |
1042+ (:\s*(
908− (=\s*(
1043+ (<) |
909− ((async\s+)?(
1044+ ([(]\s*(
910− (function\s*[(<*]) |
1045+ ([)]) |
911− (function\s+) |
1046+ (\.\.\.) |
912− ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1047+ ([_$[:alnum:]]+\s*(
913− )) |
1048+ ([:,?=])|
914− ((async\s*)?(
1049+ ([)]\s*=>)
915− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
1050+ ))
916− # sure shot arrow functions even if => is on new line
1051+ ))
917− (
1052+ )) |
918− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
1053+ (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
919− [(]\s*
1054+ (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
920− (
1055+ (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
921− ([)]\s*:) | # ():
1056+ ((async\s+)?(
922− ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1057+ (function\s*[(<*]) |
923− )
1058+ (function\s+) |
924− ) |
1059+ ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
925− (
1060+ )) |
926− [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
1061+ ((async\s*)?(
927− ) |
1062+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
928− # arrow function possible to detect only with => on same line
1063+ # sure shot arrow functions even if => is on new line
929− (
1064+ (
930− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
1065+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
931− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1066+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
932− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
1067+ (
933− \s*=> # arrow operator
1068+ ([)]\s*:) | # ():
934− )
1069+ ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
935− ))
1070+ )
936− )) |
1071+ ) |
937− # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
1072+
938− (:\s*(
1073+ # arrow function possible to detect only with => on same line
939− (<) |
1074+ (
940− ([(]\s*(
1075+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
941− ([)]) |
1076+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
942− (\.\.\.) |
1077+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
943− ([_$[:alnum:]]+\s*(
1078+ \s*=> # arrow operator
944− ([:,?=])|
1079+ )
945− ([)]\s*=>)
1080+ ))
946− ))
1081+ )))
947− ))
1082+ captures:
948− )) |
1083+ 1: meta.definition.property.ts entity.name.function.ts
949− (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$))) |
1084+ 2: keyword.operator.optional.ts
950− (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
1085+ 3: keyword.operator.definiteassignment.ts
951− ((async\s+)?(
1086+ - match: "[_$[:alpha:]][_$[:alnum:]]*"
952− (function\s*[(<*]) |
1087+ scope: meta.definition.property.ts variable.object.property.ts
953− (function\s+) |
1088+ - match: \?
954− ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1089+ scope: keyword.operator.optional.ts
955− )) |
1090+ - match: \!
956− ((async\s*)?(
1091+ scope: keyword.operator.definiteassignment.ts
957− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
958− # sure shot arrow functions even if => is on new line
959− (
960− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
961− [(]\s*
962− (
963− ([)]\s*:) | # ():
964− ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
965− )
966− ) |
967− (
968− [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
969− ) |
970− # arrow function possible to detect only with => on same line
971− (
972− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
973− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
974− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
975− \s*=> # arrow operator
976− )
977− ))
978− )))
979− captures:
980− 1: meta.definition.property.ts entity.name.function.ts
981− 2: keyword.operator.optional.ts
982− - match: "[_$[:alpha:]][_$[:alnum:]]*"
983− scope: meta.definition.property.ts variable.object.property.ts
984− - match: \?
985− scope: keyword.operator.optional.ts
986 for-loop:
1092 for-loop:
987 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))for(?=((\s+|(\s*\/\*([^\*]|(\*[^\/]))*\*\/\s*))await)?\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)?(\())'
1093 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))for(?=((\s+|(\s*\/\*([^\*]|(\*[^\/]))*\*\/\s*))await)?\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)?(\())'
988 captures:
1094 captures:
@@ -1013,39 +1119,37 @@ contexts:
1013 - match: \*
1119 - match: \*
1014 scope: keyword.generator.asterisk.ts
1120 scope: keyword.generator.asterisk.ts
1015 function-call:
1121 function-call:
1016− - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\s*(\?\.\s*)?(<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\()'
1122+ - match: '(?=(((([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))\s*(?:(\?\.\s*)|(\!))?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\()'
1017 push:
1123 push:
1018− - match: '(?<=\))(?!(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\s*(\?\.\s*)?(<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\()'
1124+ - match: '(?<=\))(?!(((([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))\s*(?:(\?\.\s*)|(\!))?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\()'
1019 pop: true
1125 pop: true
1020 - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))'
1126 - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))'
1021 push:
1127 push:
1022 - meta_scope: meta.function-call.ts
1128 - meta_scope: meta.function-call.ts
1023− - match: '(?=\s*(\?\.\s*)?(<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\()'
1129+ - match: '(?=\s*(?:(\?\.\s*)|(\!))?(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\()'
1024 pop: true
1130 pop: true
1025− - include: literal
1131+ - include: support-function-call-identifiers
1026− - include: support-objects
1027− - include: object-identifiers
1028− - include: punctuation-accessor
1029− - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))import(?=\s*[\(]\s*[\"\''\`]))'
1030− scope: keyword.operator.expression.import.ts
1031 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
1132 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
1032 scope: entity.name.function.ts
1133 scope: entity.name.function.ts
1033 - include: comment
1134 - include: comment
1034 - match: \?\.
1135 - match: \?\.
1035 scope: meta.function-call.ts punctuation.accessor.optional.ts
1136 scope: meta.function-call.ts punctuation.accessor.optional.ts
1137+ - match: \!
1138+ scope: meta.function-call.ts keyword.operator.definiteassignment.ts
1036 - include: type-arguments
1139 - include: type-arguments
1037 - include: paren-expression
1140 - include: paren-expression
1038 function-declaration:
1141 function-declaration:
1039− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*'
1142+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*'
1040 captures:
1143 captures:
1041 1: keyword.control.export.ts
1144 1: keyword.control.export.ts
1042− 2: storage.modifier.async.ts
1145+ 2: storage.modifier.ts
1146+ 3: storage.modifier.async.ts
1043− 3: storage.type.function.ts
1147+ 4: storage.type.function.ts
1044− 4: keyword.generator.asterisk.ts
1148+ 5: keyword.generator.asterisk.ts
1045− 5: meta.definition.function.ts entity.name.function.ts
1149+ 6: meta.definition.function.ts entity.name.function.ts
1046 push:
1150 push:
1047 - meta_scope: meta.function.ts
1151 - meta_scope: meta.function.ts
1048− - match: '(?=$|^|;)|(?<=\})'
1152+ - match: '(?=;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|(?<=\})'
1049 pop: true
1153 pop: true
1050 - include: function-name
1154 - include: function-name
1051 - include: function-body
1155 - include: function-body
@@ -1058,9 +1162,10 @@ contexts:
1058 4: meta.definition.function.ts entity.name.function.ts
1162 4: meta.definition.function.ts entity.name.function.ts
1059 push:
1163 push:
1060 - meta_scope: meta.function.expression.ts
1164 - meta_scope: meta.function.expression.ts
1061− - match: '(?<=\})'
1165+ - match: '(?=;)|(?<=\})'
1062 pop: true
1166 pop: true
1063 - include: function-name
1167 - include: function-name
1168+ - include: single-line-comment-consuming-line-ending
1064 - include: function-body
1169 - include: function-body
1065 function-name:
1170 function-name:
1066 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1171 - match: "[_$[:alpha:]][_$[:alnum:]]*"
@@ -1078,10 +1183,11 @@ contexts:
1078 - include: function-parameters-body
1183 - include: function-parameters-body
1079 function-parameters-body:
1184 function-parameters-body:
1080 - include: comment
1185 - include: comment
1186+ - include: string
1081 - include: decorator
1187 - include: decorator
1082 - include: destructuring-parameter
1188 - include: destructuring-parameter
1083 - include: parameter-name
1189 - include: parameter-name
1084− - include: type-annotation
1190+ - include: parameter-type-annotation
1085 - include: variable-initializer
1191 - include: variable-initializer
1086 - match: ","
1192 - match: ","
1087 scope: punctuation.separator.parameter.ts
1193 scope: punctuation.separator.parameter.ts
@@ -1095,24 +1201,22 @@ contexts:
1095 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1201 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1096 )) |
1202 )) |
1097 ((async\s*)?(
1203 ((async\s*)?(
1098− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
1204+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1099 # sure shot arrow functions even if => is on new line
1205 # sure shot arrow functions even if => is on new line
1100 (
1206 (
1101− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
1207+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1102− [(]\s*
1208+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1103 (
1209 (
1104 ([)]\s*:) | # ():
1210 ([)]\s*:) | # ():
1105 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1211 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1106 )
1212 )
1107 ) |
1213 ) |
1108− (
1214+
1109− [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
1110− ) |
1111 # arrow function possible to detect only with => on same line
1215 # arrow function possible to detect only with => on same line
1112 (
1216 (
1113− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
1217+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1114− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1218+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1115− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
1219+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1116 \s*=> # arrow operator
1220 \s*=> # arrow operator
1117 )
1221 )
1118 ))
1222 ))
@@ -1135,15 +1239,45 @@ contexts:
1135 scope: variable.other.constant.ts
1239 scope: variable.other.constant.ts
1136 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1240 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1137 scope: variable.other.readwrite.ts
1241 scope: variable.other.readwrite.ts
1242+ if-statement:
1243+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?=\bif\s*(\(([^\(\)]|(\([^\(\)]*\)))*\))\s*(?!\{))'
1244+ push:
1245+ - match: '(?=;|$|\})'
1246+ pop: true
1247+ - include: comment
1248+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(if)\s*(\()'
1249+ captures:
1250+ 1: keyword.control.conditional.ts
1251+ 2: meta.brace.round.ts
1252+ push:
1253+ - match: \)
1254+ captures:
1255+ 0: meta.brace.round.ts
1256+ pop: true
1257+ - include: expression
1258+ - match: '(?<=\))\s*\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$]))'
1259+ captures:
1260+ 0: punctuation.definition.string.begin.ts
1261+ push:
1262+ - meta_scope: string.regexp.ts
1263+ - match: "(/)([gimsuy]*)"
1264+ captures:
1265+ 1: punctuation.definition.string.end.ts
1266+ 2: keyword.other.ts
1267+ pop: true
1268+ - include: regexp
1269+ - include: statements
1138 import-declaration:
1270 import-declaration:
1139− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?\b(import)(?!\s*[:\(])(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1271+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)(?!\s*[:\(])(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1140 captures:
1272 captures:
1141 1: keyword.control.export.ts
1273 1: keyword.control.export.ts
1274+ 2: storage.modifier.ts
1142− 2: keyword.control.import.ts
1275+ 3: keyword.control.import.ts
1143 push:
1276 push:
1144 - meta_scope: meta.import.ts
1277 - meta_scope: meta.import.ts
1145 - match: '(?<!^import|[^\._$[:alnum:]]import)(?=;|$|^)'
1278 - match: '(?<!^import|[^\._$[:alnum:]]import)(?=;|$|^)'
1146 pop: true
1279 pop: true
1280+ - include: single-line-comment-consuming-line-ending
1147 - include: comment
1281 - include: comment
1148 - include: string
1282 - include: string
1149 - match: '(?<=^import|[^\._$[:alnum:]]import)(?!\s*["''])'
1283 - match: '(?<=^import|[^\._$[:alnum:]]import)(?!\s*["''])'
@@ -1155,14 +1289,15 @@ contexts:
1155 - include: import-export-declaration
1289 - include: import-export-declaration
1156 - include: import-export-declaration
1290 - include: import-export-declaration
1157 import-equals-declaration:
1291 import-equals-declaration:
1158− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(require)\s*(\()'
1292+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(require)\s*(\()'
1159 captures:
1293 captures:
1160 1: keyword.control.export.ts
1294 1: keyword.control.export.ts
1295+ 2: storage.modifier.ts
1161− 2: keyword.control.import.ts
1296+ 3: keyword.control.import.ts
1162− 3: variable.other.readwrite.alias.ts
1297+ 4: variable.other.readwrite.alias.ts
1163− 4: keyword.operator.assignment.ts
1298+ 5: keyword.operator.assignment.ts
1164− 5: keyword.control.require.ts
1299+ 6: keyword.control.require.ts
1165− 6: meta.brace.round.ts
1300+ 7: meta.brace.round.ts
1166 push:
1301 push:
1167 - meta_scope: meta.import-equals.external.ts
1302 - meta_scope: meta.import-equals.external.ts
1168 - match: \)
1303 - match: \)
@@ -1171,16 +1306,18 @@ contexts:
1171 pop: true
1306 pop: true
1172 - include: comment
1307 - include: comment
1173 - include: string
1308 - include: string
1174− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(?!require\b)'
1309+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(?!require\b)'
1175 captures:
1310 captures:
1176 1: keyword.control.export.ts
1311 1: keyword.control.export.ts
1312+ 2: storage.modifier.ts
1177− 2: keyword.control.import.ts
1313+ 3: keyword.control.import.ts
1178− 3: variable.other.readwrite.alias.ts
1314+ 4: variable.other.readwrite.alias.ts
1179− 4: keyword.operator.assignment.ts
1315+ 5: keyword.operator.assignment.ts
1180 push:
1316 push:
1181 - meta_scope: meta.import-equals.internal.ts
1317 - meta_scope: meta.import-equals.internal.ts
1182 - match: (?=;|$|^)
1318 - match: (?=;|$|^)
1183 pop: true
1319 pop: true
1320+ - include: single-line-comment-consuming-line-ending
1184 - include: comment
1321 - include: comment
1185 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))'
1322 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))'
1186 captures:
1323 captures:
@@ -1202,7 +1339,7 @@ contexts:
1202 - include: import-export-clause
1339 - include: import-export-clause
1203 import-export-clause:
1340 import-export-clause:
1204 - include: comment
1341 - include: comment
1205− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bdefault)|(\*)|(\b[_$[:alpha:]][_$[:alnum:]]*))\s+(as)\s+(?:(\bdefault(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|(\b[_$[:alpha:]][_$[:alnum:]]*))'
1342+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bdefault)|(\*)|(\b[_$[:alpha:]][_$[:alnum:]]*))\s+(as)\s+(?:(default(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|([_$[:alpha:]][_$[:alnum:]]*))'
1206 captures:
1343 captures:
1207 1: keyword.control.default.ts
1344 1: keyword.control.default.ts
1208 2: constant.language.import-export-all.ts
1345 2: constant.language.import-export-all.ts
@@ -1289,11 +1426,12 @@ contexts:
1289 pop: true
1426 pop: true
1290 - include: type
1427 - include: type
1291 interface-declaration:
1428 interface-declaration:
1292− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(export)\s+)?\b(?:(abstract)\s+)?\b(interface)\b(?=\s+|/[/*])'
1429+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(?:(abstract)\s+)?\b(interface)\b(?=\s+|/[/*])'
1293 captures:
1430 captures:
1294 1: keyword.control.export.ts
1431 1: keyword.control.export.ts
1295 2: storage.modifier.ts
1432 2: storage.modifier.ts
1433+ 3: storage.modifier.ts
1296− 3: storage.type.interface.ts
1434+ 4: storage.type.interface.ts
1297 push:
1435 push:
1298 - meta_scope: meta.interface.ts
1436 - meta_scope: meta.interface.ts
1299 - match: '(?<=\})'
1437 - match: '(?<=\})'
@@ -1355,7 +1493,7 @@ contexts:
1355 pop: true
1493 pop: true
1356 - include: method-declaration-name
1494 - include: method-declaration-name
1357 - include: function-body
1495 - include: function-body
1358− - match: '(?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:(?:\s*\b(new)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|(?:(\*)\s*)?)(?=\s*[\(\<])'
1496+ - match: '(?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:(?:\s*\b(new)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|(?:(\*)\s*)?)(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])'
1359 captures:
1497 captures:
1360 1: storage.modifier.ts
1498 1: storage.modifier.ts
1361 2: storage.modifier.ts
1499 2: storage.modifier.ts
@@ -1369,16 +1507,16 @@ contexts:
1369 - include: method-declaration-name
1507 - include: method-declaration-name
1370 - include: function-body
1508 - include: function-body
1371 - match: |-
1509 - match: |-
1372− (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1510+ (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1373− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1511+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1374− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1512+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1375− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1513+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1376− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1514+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1377− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1515+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1378− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1516+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1379− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1517+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1380− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1518+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1381− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*[\(\<])
1519+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1382 captures:
1520 captures:
1383 1: storage.modifier.ts
1521 1: storage.modifier.ts
1384 2: storage.modifier.ts
1522 2: storage.modifier.ts
@@ -1393,16 +1531,16 @@ contexts:
1393 - include: function-body
1531 - include: function-body
1394 method-declaration-name:
1532 method-declaration-name:
1395 - match: |-
1533 - match: |-
1396− (?x)(?=((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1534+ (?x)(?=((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1397− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1535+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1398− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1536+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1399− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1537+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1400− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1538+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1401− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1539+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1402− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1540+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1403− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1541+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1404− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1542+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1405− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??)\s*[\(\<])
1543+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??)\s*[\(\<])
1406 push:
1544 push:
1407 - match: (?=\(|\<)
1545 - match: (?=\(|\<)
1408 pop: true
1546 pop: true
@@ -1414,13 +1552,14 @@ contexts:
1414 - match: \?
1552 - match: \?
1415 scope: keyword.operator.optional.ts
1553 scope: keyword.operator.optional.ts
1416 namespace-declaration:
1554 namespace-declaration:
1417− - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?\b(namespace|module)\s+(?=[_$[:alpha:]"''`]))'
1555+ - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(namespace|module)\s+(?=[_$[:alpha:]"''`]))'
1418 captures:
1556 captures:
1419 1: keyword.control.export.ts
1557 1: keyword.control.export.ts
1558+ 2: storage.modifier.ts
1420− 2: storage.type.namespace.ts
1559+ 3: storage.type.namespace.ts
1421 push:
1560 push:
1422 - meta_scope: meta.namespace.declaration.ts
1561 - meta_scope: meta.namespace.declaration.ts
1423− - match: '(?<=\})|(?=;|^\s*abstract\b|^\s*async\b|^\s*class\b|^\s*const\b|^\s*declare\b|^\s*enum\b|^\s*export\b|^\s*function\b|^\s*import\b|^\s*interface\b|^\s*let\b|^\s*module\b|^\s*namespace\b|^\s*return\b|^\s*type\b|^\s*var\b)'
1562+ - match: '(?<=\})|(?=;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
1424 pop: true
1563 pop: true
1425 - include: comment
1564 - include: comment
1426 - include: string
1565 - include: string
@@ -1434,7 +1573,7 @@ contexts:
1434 1: keyword.operator.new.ts
1573 1: keyword.operator.new.ts
1435 push:
1574 push:
1436 - meta_scope: new.expr.ts
1575 - meta_scope: new.expr.ts
1437− - match: '(?<=\))|(?=[;),}\]:]|\|\||\&\&|$|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))new(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))function((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))'
1576+ - match: '(?<=\))|(?=[;),}\]:\-\+]|\|\||\&\&|$|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))new(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))function((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))'
1438 pop: true
1577 pop: true
1439 - include: paren-expression
1578 - include: paren-expression
1440 - include: class-declaration
1579 - include: class-declaration
@@ -1443,32 +1582,46 @@ contexts:
1443 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))null(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1582 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))null(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1444 scope: constant.language.null.ts
1583 scope: constant.language.null.ts
1445 numeric-literal:
1584 numeric-literal:
1446− - match: '\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$)'
1585+ - match: '\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$)'
1447 scope: constant.numeric.hex.ts
1586 scope: constant.numeric.hex.ts
1587+ captures:
1588+ 1: storage.type.numeric.bigint.ts
1448− - match: '\b(?<!\$)0(b|B)[01][01_]*\b(?!\$)'
1589+ - match: '\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$)'
1449 scope: constant.numeric.binary.ts
1590 scope: constant.numeric.binary.ts
1591+ captures:
1592+ 1: storage.type.numeric.bigint.ts
1450− - match: '\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$)'
1593+ - match: '\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$)'
1451 scope: constant.numeric.octal.ts
1594 scope: constant.numeric.octal.ts
1595+ captures:
1596+ 1: storage.type.numeric.bigint.ts
1452 - match: |-
1597 - match: |-
1453 (?x)
1598 (?x)
1454 (?<!\$)(?:
1599 (?<!\$)(?:
1455− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1600+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1456− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1601+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1457− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1602+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1458− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1603+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1459− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1604+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1460− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1605+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1461− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1606+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1462− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1607+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1463 )(?!\$)
1608 )(?!\$)
1464 captures:
1609 captures:
1465 0: constant.numeric.decimal.ts
1610 0: constant.numeric.decimal.ts
1466 1: meta.delimiter.decimal.period.ts
1611 1: meta.delimiter.decimal.period.ts
1467− 2: meta.delimiter.decimal.period.ts
1612+ 2: storage.type.numeric.bigint.ts
1468 3: meta.delimiter.decimal.period.ts
1613 3: meta.delimiter.decimal.period.ts
1469− 4: meta.delimiter.decimal.period.ts
1614+ 4: storage.type.numeric.bigint.ts
1470 5: meta.delimiter.decimal.period.ts
1615 5: meta.delimiter.decimal.period.ts
1616+ 6: storage.type.numeric.bigint.ts
1617+ 7: storage.type.numeric.bigint.ts
1618+ 8: meta.delimiter.decimal.period.ts
1619+ 9: storage.type.numeric.bigint.ts
1471− 6: meta.delimiter.decimal.period.ts
1620+ 10: meta.delimiter.decimal.period.ts
1621+ 11: storage.type.numeric.bigint.ts
1622+ 12: meta.delimiter.decimal.period.ts
1623+ 13: storage.type.numeric.bigint.ts
1624+ 14: storage.type.numeric.bigint.ts
1472 numericConstant-literal:
1625 numericConstant-literal:
1473 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))NaN(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1626 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))NaN(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1474 scope: constant.language.nan.ts
1627 scope: constant.language.nan.ts
@@ -1477,16 +1630,16 @@ contexts:
1477 object-binding-element:
1630 object-binding-element:
1478 - include: comment
1631 - include: comment
1479 - match: |-
1632 - match: |-
1480− (?x)(?=((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1633+ (?x)(?=((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1481− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1634+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1482− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1635+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1483− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1636+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1484− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1637+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1485− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1638+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1486− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1639+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1487− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1640+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1488− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1641+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1489− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1642+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1490 push:
1643 push:
1491 - match: '(?=,|\})'
1644 - match: '(?=,|\})'
1492 pop: true
1645 pop: true
@@ -1499,16 +1652,16 @@ contexts:
1499 object-binding-element-const:
1652 object-binding-element-const:
1500 - include: comment
1653 - include: comment
1501 - match: |-
1654 - match: |-
1502− (?x)(?=((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1655+ (?x)(?=((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1503− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1656+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1504− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1657+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1505− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1658+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1506− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1659+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1507− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1660+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1508− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1661+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1509− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1662+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1510− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1663+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1511− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1664+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1512 push:
1665 push:
1513 - match: '(?=,|\})'
1666 - match: '(?=,|\})'
1514 pop: true
1667 pop: true
@@ -1520,16 +1673,16 @@ contexts:
1520 - include: punctuation-comma
1673 - include: punctuation-comma
1521 object-binding-element-propertyName:
1674 object-binding-element-propertyName:
1522 - match: |-
1675 - match: |-
1523− (?x)(?=((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1676+ (?x)(?=((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1524− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1677+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1525− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1678+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1526− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1679+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1527− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1680+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1528− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1681+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1529− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1682+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1530− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1683+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1531− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1684+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1532− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1685+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1533 push:
1686 push:
1534 - match: (:)
1687 - match: (:)
1535 captures:
1688 captures:
@@ -1596,16 +1749,16 @@ contexts:
1596 - include: object-member
1749 - include: object-member
1597 object-literal-method-declaration:
1750 object-literal-method-declaration:
1598 - match: |-
1751 - match: |-
1599− (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1752+ (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1600− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1753+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1601− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1754+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1602− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1755+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1603− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1756+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1604− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1757+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1605− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1758+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1606− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1759+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1607− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1760+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1608− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*[\(\<])
1761+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1609 captures:
1762 captures:
1610 1: storage.modifier.async.ts
1763 1: storage.modifier.async.ts
1611 2: storage.type.property.ts
1764 2: storage.type.property.ts
@@ -1617,16 +1770,16 @@ contexts:
1617 - include: method-declaration-name
1770 - include: method-declaration-name
1618 - include: function-body
1771 - include: function-body
1619 - match: |-
1772 - match: |-
1620− (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1773+ (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1621− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1774+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1622− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1775+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1623− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1776+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1624− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1777+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1625− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1778+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1626− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1779+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1627− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1780+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1628− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1781+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1629− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*[\(\<])
1782+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1630 captures:
1783 captures:
1631 1: storage.modifier.async.ts
1784 1: storage.modifier.async.ts
1632 2: storage.type.property.ts
1785 2: storage.type.property.ts
@@ -1643,50 +1796,67 @@ contexts:
1643 - meta_scope: meta.object.member.ts meta.object-literal.key.ts
1796 - meta_scope: meta.object.member.ts meta.object-literal.key.ts
1644 - match: '(?=:)|((?<=[\]])(?=\s*[\(\<]))'
1797 - match: '(?=:)|((?<=[\]])(?=\s*[\(\<]))'
1645 pop: true
1798 pop: true
1799+ - include: comment
1646 - include: array-literal
1800 - include: array-literal
1647− - match: '(?=[\''\"])'
1801+ - match: '(?=[\''\"\`])'
1648 push:
1802 push:
1649 - meta_scope: meta.object.member.ts meta.object-literal.key.ts
1803 - meta_scope: meta.object.member.ts meta.object-literal.key.ts
1650− - match: '(?=:)|((?<=[\''\"])(?=\s*[\(\<]))'
1804+ - match: '(?=:)|((?<=[\''\"\`])(?=((\s*[\(\<,}])|(\s+(as)\s+))))'
1651 pop: true
1805 pop: true
1806+ - include: comment
1652 - include: string
1807 - include: string
1653− - match: '(?<=[\]\''\"])(?=\s*[\(\<])'
1808+ - match: |-
1809+ (?x)(?=(\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1810+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1811+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1812+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1813+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1814+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1815+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1816+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1817+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1818+ )(?!\$)))
1819+ push:
1820+ - meta_scope: meta.object.member.ts meta.object-literal.key.ts
1821+ - match: '(?=:)|(?=\s*([\(\<,}])|(\s+as\s+))'
1822+ pop: true
1823+ - include: comment
1824+ - include: numeric-literal
1825+ - match: '(?<=[\]\''\"\`])(?=\s*[\(\<])'
1654 push:
1826 push:
1655 - meta_scope: meta.method.declaration.ts
1827 - meta_scope: meta.method.declaration.ts
1656 - match: '(?=\}|;|,)|(?<=\})'
1828 - match: '(?=\}|;|,)|(?<=\})'
1657 pop: true
1829 pop: true
1658 - include: function-body
1830 - include: function-body
1659− - match: '(?![_$[:alpha:]])([[:digit:]]+)\s*(?=:)'
1831+ - match: '(?![_$[:alpha:]])([[:digit:]]+)\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*:)'
1660 scope: meta.object.member.ts
1832 scope: meta.object.member.ts
1661 captures:
1833 captures:
1662 0: meta.object-literal.key.ts
1834 0: meta.object-literal.key.ts
1663 1: constant.numeric.decimal.ts
1835 1: constant.numeric.decimal.ts
1664 - match: |-
1836 - match: |-
1665− (?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\s*(?=:\s*(
1837+ (?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*:(\s*\/\*([^\*]|(\*[^\/]))*\*\/)*\s*(
1666 ((async\s+)?(
1838 ((async\s+)?(
1667 (function\s*[(<*]) |
1839 (function\s*[(<*]) |
1668 (function\s+) |
1840 (function\s+) |
1669 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1841 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1670 )) |
1842 )) |
1671 ((async\s*)?(
1843 ((async\s*)?(
1672− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
1844+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1673 # sure shot arrow functions even if => is on new line
1845 # sure shot arrow functions even if => is on new line
1674 (
1846 (
1675− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
1847+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1676− [(]\s*
1848+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1677 (
1849 (
1678 ([)]\s*:) | # ():
1850 ([)]\s*:) | # ():
1679 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1851 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1680 )
1852 )
1681 ) |
1853 ) |
1682− (
1854+
1683− [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
1684− ) |
1685 # arrow function possible to detect only with => on same line
1855 # arrow function possible to detect only with => on same line
1686 (
1856 (
1687− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
1857+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1688− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1858+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1689− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
1859+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1690 \s*=> # arrow operator
1860 \s*=> # arrow operator
1691 )
1861 )
1692 ))
1862 ))
@@ -1695,7 +1865,7 @@ contexts:
1695 captures:
1865 captures:
1696 0: meta.object-literal.key.ts
1866 0: meta.object-literal.key.ts
1697 1: entity.name.function.ts
1867 1: entity.name.function.ts
1698− - match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\s*(?=:)'
1868+ - match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*:)'
1699 scope: meta.object.member.ts
1869 scope: meta.object.member.ts
1700 captures:
1870 captures:
1701 0: meta.object-literal.key.ts
1871 0: meta.object-literal.key.ts
@@ -1707,14 +1877,27 @@ contexts:
1707 - match: '(?=,|\})'
1877 - match: '(?=,|\})'
1708 pop: true
1878 pop: true
1709 - include: expression
1879 - include: expression
1710− - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?=,|\}|$)'
1880+ - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?=,|\}|$|\/\/|\/\*)'
1711 scope: meta.object.member.ts
1881 scope: meta.object.member.ts
1712 captures:
1882 captures:
1713 1: variable.other.readwrite.ts
1883 1: variable.other.readwrite.ts
1884+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+(const)(?=\s*([,}]|$))'
1885+ scope: meta.object.member.ts
1886+ captures:
1887+ 1: keyword.control.as.ts
1888+ 2: storage.modifier.ts
1889+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+'
1890+ captures:
1891+ 1: keyword.control.as.ts
1892+ push:
1893+ - meta_scope: meta.object.member.ts
1894+ - match: '(?=$|^|[,}]|\|\||\&\&|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+))'
1895+ pop: true
1896+ - include: type
1714 - match: '(?=[_$[:alpha:]][_$[:alnum:]]*\s*=)'
1897 - match: '(?=[_$[:alpha:]][_$[:alnum:]]*\s*=)'
1715 push:
1898 push:
1716 - meta_scope: meta.object.member.ts
1899 - meta_scope: meta.object.member.ts
1717− - match: '(?=,|\}|$)'
1900+ - match: '(?=,|\}|$|\/\/|\/\*)'
1718 pop: true
1901 pop: true
1719 - include: expression
1902 - include: expression
1720 - match: ":"
1903 - match: ":"
@@ -1724,7 +1907,7 @@ contexts:
1724 - meta_scope: meta.object.member.ts
1907 - meta_scope: meta.object.member.ts
1725 - match: '(?=,|\})'
1908 - match: '(?=,|\})'
1726 pop: true
1909 pop: true
1727− - match: '(?<=:)\s*(async)?(?=\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)\(\s*([\{\[]\s*)?$)'
1910+ - match: '(?<=:)\s*(async)?(?=\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)\(\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1728 captures:
1911 captures:
1729 1: storage.modifier.async.ts
1912 1: storage.modifier.async.ts
1730 push:
1913 push:
@@ -1740,7 +1923,7 @@ contexts:
1740 0: meta.brace.round.ts
1923 0: meta.brace.round.ts
1741 pop: true
1924 pop: true
1742 - include: expression-inside-possibly-arrow-parens
1925 - include: expression-inside-possibly-arrow-parens
1743− - match: '(?<=:)\s*(async)?\s*(\()(?=\s*([\{\[]\s*)?$)'
1926+ - match: '(?<=:)\s*(async)?\s*(\()(?=\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1744 captures:
1927 captures:
1745 1: storage.modifier.async.ts
1928 1: storage.modifier.async.ts
1746 2: meta.brace.round.ts
1929 2: meta.brace.round.ts
@@ -1750,6 +1933,7 @@ contexts:
1750 0: meta.brace.round.ts
1933 0: meta.brace.round.ts
1751 pop: true
1934 pop: true
1752 - include: expression-inside-possibly-arrow-parens
1935 - include: expression-inside-possibly-arrow-parens
1936+ - include: possibly-arrow-return-type
1753 - include: expression
1937 - include: expression
1754 - include: punctuation-comma
1938 - include: punctuation-comma
1755 parameter-array-binding-pattern:
1939 parameter-array-binding-pattern:
@@ -1767,6 +1951,8 @@ contexts:
1767 parameter-binding-element:
1951 parameter-binding-element:
1768 - include: comment
1952 - include: comment
1769 - include: string
1953 - include: string
1954+ - include: numeric-literal
1955+ - include: regex
1770 - include: parameter-object-binding-pattern
1956 - include: parameter-object-binding-pattern
1771 - include: parameter-array-binding-pattern
1957 - include: parameter-array-binding-pattern
1772 - include: destructuring-parameter-rest
1958 - include: destructuring-parameter-rest
@@ -1785,24 +1971,22 @@ contexts:
1785 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1971 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1786 )) |
1972 )) |
1787 ((async\s*)?(
1973 ((async\s*)?(
1788− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
1974+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1789 # sure shot arrow functions even if => is on new line
1975 # sure shot arrow functions even if => is on new line
1790 (
1976 (
1791− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
1977+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1792− [(]\s*
1978+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1793 (
1979 (
1794 ([)]\s*:) | # ():
1980 ([)]\s*:) | # ():
1795 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1981 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1796 )
1982 )
1797 ) |
1983 ) |
1798− (
1984+
1799− [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
1800− ) |
1801 # arrow function possible to detect only with => on same line
1985 # arrow function possible to detect only with => on same line
1802 (
1986 (
1803− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
1987+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1804− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1988+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1805− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
1989+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1806 \s*=> # arrow operator
1990 \s*=> # arrow operator
1807 )
1991 )
1808 ))
1992 ))
@@ -1819,7 +2003,8 @@ contexts:
1819 ))
2003 ))
1820 ))
2004 ))
1821 )) |
2005 )) |
2006+ (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
1822− (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$))) |
2007+ (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
1823 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
2008 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
1824 ((async\s+)?(
2009 ((async\s+)?(
1825 (function\s*[(<*]) |
2010 (function\s*[(<*]) |
@@ -1827,24 +2012,22 @@ contexts:
1827 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
2012 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1828 )) |
2013 )) |
1829 ((async\s*)?(
2014 ((async\s*)?(
1830− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
2015+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1831 # sure shot arrow functions even if => is on new line
2016 # sure shot arrow functions even if => is on new line
1832 (
2017 (
1833− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
2018+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1834− [(]\s*
2019+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1835 (
2020 (
1836 ([)]\s*:) | # ():
2021 ([)]\s*:) | # ():
1837 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
2022 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1838 )
2023 )
1839 ) |
2024 ) |
1840− (
2025+
1841− [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
1842− ) |
1843 # arrow function possible to detect only with => on same line
2026 # arrow function possible to detect only with => on same line
1844 (
2027 (
1845− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
2028+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1846− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
2029+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1847− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
2030+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1848 \s*=> # arrow operator
2031 \s*=> # arrow operator
1849 )
2032 )
1850 ))
2033 ))
@@ -1865,16 +2048,16 @@ contexts:
1865 parameter-object-binding-element:
2048 parameter-object-binding-element:
1866 - include: comment
2049 - include: comment
1867 - match: |-
2050 - match: |-
1868− (?x)(?=((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
2051+ (?x)(?=((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1869− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
2052+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1870− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
2053+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1871− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
2054+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1872− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
2055+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1873− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
2056+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1874− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
2057+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1875− (?:\B(\.)[0-9][0-9_]*\b)| # .1
2058+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1876− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
2059+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1877− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
2060+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1878 push:
2061 push:
1879 - match: '(?=,|\})'
2062 - match: '(?=,|\})'
1880 pop: true
2063 pop: true
@@ -1895,6 +2078,15 @@ contexts:
1895 0: punctuation.definition.binding-pattern.object.ts
2078 0: punctuation.definition.binding-pattern.object.ts
1896 pop: true
2079 pop: true
1897 - include: parameter-object-binding-element
2080 - include: parameter-object-binding-element
2081+ parameter-type-annotation:
2082+ - match: (:)
2083+ captures:
2084+ 1: keyword.operator.type.annotation.ts
2085+ push:
2086+ - meta_scope: meta.type.annotation.ts
2087+ - match: "(?=[,)])|(?==[^>])"
2088+ pop: true
2089+ - include: type
1898 paren-expression:
2090 paren-expression:
1899 - match: \(
2091 - match: \(
1900 captures:
2092 captures:
@@ -1906,14 +2098,14 @@ contexts:
1906 pop: true
2098 pop: true
1907 - include: expression
2099 - include: expression
1908 paren-expression-possibly-arrow:
2100 paren-expression-possibly-arrow:
1909− - match: '(?<=[(=,])\s*(async)?(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?\(\s*[\{\[]\s*$)'
2101+ - match: '(?<=[(=,])\s*(async)?(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?\(\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1910 captures:
2102 captures:
1911 1: storage.modifier.async.ts
2103 1: storage.modifier.async.ts
1912 push:
2104 push:
1913 - match: (?<=\))
2105 - match: (?<=\))
1914 pop: true
2106 pop: true
1915 - include: paren-expression-possibly-arrow-with-typeparameters
2107 - include: paren-expression-possibly-arrow-with-typeparameters
1916− - match: '(?<=[(=,]|=>)\s*(async)?(?=\s*((((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?\()|(<))\s*$)'
2108+ - match: '(?<=[(=,]|=>|^return|[^\._$[:alnum:]]return)\s*(async)?(?=\s*((((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?\()|(<))\s*$)'
1917 captures:
2109 captures:
1918 1: storage.modifier.async.ts
2110 1: storage.modifier.async.ts
1919 push:
2111 push:
@@ -1933,7 +2125,7 @@ contexts:
1933 pop: true
2125 pop: true
1934 - include: expression-inside-possibly-arrow-parens
2126 - include: expression-inside-possibly-arrow-parens
1935 possibly-arrow-return-type:
2127 possibly-arrow-return-type:
1936− - match: '(?<=\))\s*(:)(?=\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+\s*=>)'
2128+ - match: '(?<=\)|^)\s*(:)(?=\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*=>)'
1937 captures:
2129 captures:
1938 1: meta.arrow.ts meta.return.type.arrow.ts keyword.operator.type.annotation.ts
2130 1: meta.arrow.ts meta.return.type.arrow.ts keyword.operator.type.annotation.ts
1939 push:
2131 push:
@@ -1980,7 +2172,7 @@ contexts:
1980 pop: true
2172 pop: true
1981 - include: string-character-escape
2173 - include: string-character-escape
1982 regex:
2174 regex:
1983− - match: '(?<!\+\+|--|})(?<=[=(:,\[?+!]|^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$]))'
2175+ - match: '(?<!\+\+|--|})(?<=[=(:,\[?+!]|^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[\()]|\\.|\[([^\]\\]|\\.)+\]|\(([^\)\\]|\\.)+\))+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$]))'
1984 captures:
2176 captures:
1985 1: punctuation.definition.string.begin.ts
2177 1: punctuation.definition.string.begin.ts
1986 push:
2178 push:
@@ -1991,7 +2183,7 @@ contexts:
1991 2: keyword.other.ts
2183 2: keyword.other.ts
1992 pop: true
2184 pop: true
1993 - include: regexp
2185 - include: regexp
1994− - match: '(?<![_$[:alnum:])\]]|\+\+|--|})\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$]))'
2186+ - match: '((?<![_$[:alnum:])\]]|\+\+|--|}|\*\/)|((?<=^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case))\s*)\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$]))'
1995 captures:
2187 captures:
1996 0: punctuation.definition.string.begin.ts
2188 0: punctuation.definition.string.begin.ts
1997 push:
2189 push:
@@ -2096,9 +2288,20 @@ contexts:
2096 - include: type-object
2288 - include: type-object
2097 - include: type-predicate-operator
2289 - include: type-predicate-operator
2098 - include: type
2290 - include: type
2291+ single-line-comment-consuming-line-ending:
2292+ - match: '(^[ \t]+)?((//)(?:\s*((@)internal)(?=\s|$))?)'
2293+ captures:
2294+ 1: punctuation.whitespace.comment.leading.ts
2295+ 2: comment.line.double-slash.ts
2296+ 3: punctuation.definition.comment.ts
2297+ 4: storage.type.internaldeclaration.ts
2298+ 5: punctuation.decorator.internaldeclaration.ts
2299+ push:
2300+ - meta_content_scope: comment.line.double-slash.ts
2301+ - match: (?=^)
2302+ pop: true
2099 statements:
2303 statements:
2100 - include: string
2304 - include: string
2101− - include: template
2102 - include: comment
2305 - include: comment
2103 - include: declaration
2306 - include: declaration
2104 - include: control-statement
2307 - include: control-statement
@@ -2110,18 +2313,26 @@ contexts:
2110 string:
2313 string:
2111 - include: qstring-single
2314 - include: qstring-single
2112 - include: qstring-double
2315 - include: qstring-double
2316+ - include: template
2113 string-character-escape:
2317 string-character-escape:
2114− - match: '\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)'
2318+ - match: '\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\{[0-9A-Fa-f]+\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)'
2115 scope: constant.character.escape.ts
2319 scope: constant.character.escape.ts
2116 super-literal:
2320 super-literal:
2117 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))super\b(?!\$)'
2321 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))super\b(?!\$)'
2118 scope: variable.language.super.ts
2322 scope: variable.language.super.ts
2323+ support-function-call-identifiers:
2324+ - include: literal
2325+ - include: support-objects
2326+ - include: object-identifiers
2327+ - include: punctuation-accessor
2328+ - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))import(?=\s*[\(]\s*[\"\''\`]))'
2329+ scope: keyword.operator.expression.import.ts
2119 support-objects:
2330 support-objects:
2120 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(arguments)\b(?!\$)'
2331 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(arguments)\b(?!\$)'
2121 scope: variable.language.arguments.ts
2332 scope: variable.language.arguments.ts
2122 - match: |-
2333 - match: |-
2123− (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(Array|ArrayBuffer|Atomics|Boolean|DataView|Date|Float32Array|Float64Array|Function|Generator
2334+ (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(Array|ArrayBuffer|Atomics|BigInt|BigInt64Array|BigUint64Array|Boolean|DataView|Date|Float32Array
2124− |GeneratorFunction|Int8Array|Int16Array|Int32Array|Intl|Map|Number|Object|Proxy
2335+ |Float64Array|Function|Generator|GeneratorFunction|Int8Array|Int16Array|Int32Array|Intl|Map|Number|Object|Proxy
2125 |Reflect|RegExp|Set|SharedArrayBuffer|SIMD|String|Symbol|TypedArray
2336 |Reflect|RegExp|Set|SharedArrayBuffer|SIMD|String|Symbol|TypedArray
2126 |Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|WeakMap|WeakSet)\b(?!\$)
2337 |Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|WeakMap|WeakSet)\b(?!\$)
2127 scope: support.class.builtin.ts
2338 scope: support.class.builtin.ts
@@ -2175,9 +2386,9 @@ contexts:
2175 4: support.variable.property.target.ts
2386 4: support.variable.property.target.ts
2176 - match: |-
2387 - match: |-
2177 (?x) (?:(\.)|(\?\.(?!\s*[[:digit:]]))) \s* (?:
2388 (?x) (?:(\.)|(\?\.(?!\s*[[:digit:]]))) \s* (?:
2178− (constructor|length|prototype|__proto__)
2389+ (?:(constructor|length|prototype|__proto__)\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?\())
2179 |
2390 |
2180− (EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY))\b(?!\$)
2391+ (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\b(?!\$)))
2181 captures:
2392 captures:
2182 1: punctuation.accessor.ts
2393 1: punctuation.accessor.ts
2183 2: punctuation.accessor.optional.ts
2394 2: punctuation.accessor.optional.ts
@@ -2281,7 +2492,7 @@ contexts:
2281 |siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary
2492 |siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary
2282 |systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead
2493 |systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead
2283 |title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile
2494 |title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile
2284− |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?\()
2495+ |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?\()
2285 captures:
2496 captures:
2286 1: punctuation.accessor.ts
2497 1: punctuation.accessor.ts
2287 2: punctuation.accessor.optional.ts
2498 2: punctuation.accessor.optional.ts
@@ -2405,6 +2616,7 @@ contexts:
2405 captures:
2616 captures:
2406 0: punctuation.definition.block.ts
2617 0: punctuation.definition.block.ts
2407 pop: true
2618 pop: true
2619+ - include: comment
2408 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(switch)\s*(\()'
2620 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(switch)\s*(\()'
2409 captures:
2621 captures:
2410 1: keyword.control.switch.ts
2622 1: keyword.control.switch.ts
@@ -2447,7 +2659,20 @@ contexts:
2447 0: case-clause.expr.ts punctuation.definition.section.case-statement.ts
2659 0: case-clause.expr.ts punctuation.definition.section.case-statement.ts
2448 - include: statements
2660 - include: statements
2449 template:
2661 template:
2662+ - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`)'
2663+ push:
2664+ - meta_scope: string.template.ts
2665+ - match: (?=`)
2666+ pop: true
2667+ - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))'
2668+ push:
2669+ - match: '(?=(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`)'
2670+ pop: true
2671+ - include: support-function-call-identifiers
2672+ - match: "([_$[:alpha:]][_$[:alnum:]]*)"
2673+ scope: entity.name.function.tagged-template.ts
2674+ - include: type-arguments
2450− - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?=(<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)`)'
2675+ - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?=(<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)`)'
2451 captures:
2676 captures:
2452 1: entity.name.function.tagged-template.ts
2677 1: entity.name.function.tagged-template.ts
2453 push:
2678 push:
@@ -2480,7 +2705,7 @@ contexts:
2480 pop: true
2705 pop: true
2481 - include: expression
2706 - include: expression
2482 ternary-expression:
2707 ternary-expression:
2483− - match: '(?!\?\.\s*[^[:digit:]])(\?)'
2708+ - match: '(?!\?\.\s*[^[:digit:]])(\?)(?!\?)'
2484 captures:
2709 captures:
2485 1: keyword.operator.ternary.ts
2710 1: keyword.operator.ternary.ts
2486 push:
2711 push:
@@ -2506,16 +2731,20 @@ contexts:
2506 - include: type-fn-type-parameters
2731 - include: type-fn-type-parameters
2507 - include: type-paren-or-function-parameters
2732 - include: type-paren-or-function-parameters
2508 - include: type-function-return-type
2733 - include: type-function-return-type
2734+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(readonly)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
2735+ captures:
2736+ 1: storage.modifier.ts
2509 - include: type-name
2737 - include: type-name
2510 type-alias-declaration:
2738 type-alias-declaration:
2511− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?\b(type)\b\s+([_$[:alpha:]][_$[:alnum:]]*)\s*'
2739+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(type)\b\s+([_$[:alpha:]][_$[:alnum:]]*)\s*'
2512 captures:
2740 captures:
2513 1: keyword.control.export.ts
2741 1: keyword.control.export.ts
2514− 2: storage.type.type.ts
2742+ 2: storage.modifier.ts
2743+ 3: storage.type.type.ts
2515− 3: entity.name.type.alias.ts
2744+ 4: entity.name.type.alias.ts
2516 push:
2745 push:
2517 - meta_scope: meta.type.declaration.ts
2746 - meta_scope: meta.type.declaration.ts
2518− - match: '(?=\}|;|^\s*abstract\b|^\s*async\b|^\s*class\b|^\s*const\b|^\s*declare\b|^\s*enum\b|^\s*export\b|^\s*function\b|^\s*import\b|^\s*interface\b|^\s*let\b|^\s*module\b|^\s*namespace\b|^\s*return\b|^\s*type\b|^\s*var\b)'
2747+ - match: '(?=\}|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
2519 pop: true
2748 pop: true
2520 - include: comment
2749 - include: comment
2521 - include: type-parameters
2750 - include: type-parameters
@@ -2523,7 +2752,7 @@ contexts:
2523 captures:
2752 captures:
2524 1: keyword.operator.assignment.ts
2753 1: keyword.operator.assignment.ts
2525 push:
2754 push:
2526− - match: '(?=\}|;|^\s*abstract\b|^\s*async\b|^\s*class\b|^\s*const\b|^\s*declare\b|^\s*enum\b|^\s*export\b|^\s*function\b|^\s*import\b|^\s*interface\b|^\s*let\b|^\s*module\b|^\s*namespace\b|^\s*return\b|^\s*type\b|^\s*var\b)'
2755+ - match: '(?=\}|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
2527 pop: true
2756 pop: true
2528 - include: type
2757 - include: type
2529 type-annotation:
2758 type-annotation:
@@ -2553,8 +2782,13 @@ contexts:
2553 captures:
2782 captures:
2554 0: punctuation.definition.typeparameters.end.ts
2783 0: punctuation.definition.typeparameters.end.ts
2555 pop: true
2784 pop: true
2556− - include: type
2785+ - include: type-arguments-body
2786+ type-arguments-body:
2787+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(_)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2788+ captures:
2789+ 0: keyword.operator.type.ts
2790+ - include: type
2557− - include: punctuation-comma
2791+ - include: punctuation-comma
2558 type-builtin-literals:
2792 type-builtin-literals:
2559 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(this|true|false|undefined|null|object)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2793 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(this|true|false|undefined|null|object)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2560 scope: support.type.builtin.ts
2794 scope: support.type.builtin.ts
@@ -2577,9 +2811,13 @@ contexts:
2577 - include: type
2811 - include: type
2578 type-fn-type-parameters:
2812 type-fn-type-parameters:
2579 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\b(?=\s*\<)'
2813 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\b(?=\s*\<)'
2580− scope: meta.type.constructor.ts
2581 captures:
2814 captures:
2582− 1: keyword.control.new.ts
2815+ 1: meta.type.constructor.ts keyword.control.new.ts
2816+ push:
2817+ - match: (?<=>)
2818+ pop: true
2819+ - include: comment
2820+ - include: type-parameters
2583 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\b\s*(?=\()'
2821 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\b\s*(?=\()'
2584 captures:
2822 captures:
2585 1: keyword.control.new.ts
2823 1: keyword.control.new.ts
@@ -2633,6 +2871,30 @@ contexts:
2633 - include: type-predicate-operator
2871 - include: type-predicate-operator
2634 - include: type
2872 - include: type
2635 type-name:
2873 type-name:
2874+ - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(<)'
2875+ captures:
2876+ 1: entity.name.type.module.ts
2877+ 2: punctuation.accessor.ts
2878+ 3: punctuation.accessor.optional.ts
2879+ 4: meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
2880+ push:
2881+ - meta_content_scope: meta.type.parameters.ts
2882+ - match: (>)
2883+ captures:
2884+ 1: meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
2885+ pop: true
2886+ - include: type-arguments-body
2887+ - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(<)'
2888+ captures:
2889+ 1: entity.name.type.ts
2890+ 2: meta.type.parameters.ts punctuation.definition.typeparameters.begin.ts
2891+ push:
2892+ - meta_content_scope: meta.type.parameters.ts
2893+ - match: (>)
2894+ captures:
2895+ 1: meta.type.parameters.ts punctuation.definition.typeparameters.end.ts
2896+ pop: true
2897+ - include: type-arguments-body
2636 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))'
2898 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))'
2637 captures:
2899 captures:
2638 1: entity.name.type.module.ts
2900 1: entity.name.type.module.ts
@@ -2668,18 +2930,16 @@ contexts:
2668 - include: type
2930 - include: type
2669 type-operators:
2931 type-operators:
2670 - include: typeof-operator
2932 - include: typeof-operator
2671− - match: '(?:([&|])|(=(?!>)))(?=\s*\{)'
2933+ - match: '([&|])(?=\s*\{)'
2672 captures:
2934 captures:
2673− 1: keyword.operator.type.ts
2935+ 0: keyword.operator.type.ts
2674− 2: keyword.operator.assignment.ts
2675 push:
2936 push:
2676 - match: '(?<=\})'
2937 - match: '(?<=\})'
2677 pop: true
2938 pop: true
2678 - include: type-object
2939 - include: type-object
2679− - match: "([&|])|(=(?!>))"
2940+ - match: "[&|]"
2680 captures:
2941 captures:
2681− 1: keyword.operator.type.ts
2942+ 0: keyword.operator.type.ts
2682− 2: keyword.operator.assignment.ts
2683 push:
2943 push:
2684 - match: (?=\S)
2944 - match: (?=\S)
2685 pop: true
2945 pop: true
@@ -2706,6 +2966,8 @@ contexts:
2706 scope: storage.modifier.ts
2966 scope: storage.modifier.ts
2707 - include: type
2967 - include: type
2708 - include: punctuation-comma
2968 - include: punctuation-comma
2969+ - match: (=)(?!>)
2970+ scope: keyword.operator.assignment.ts
2709 type-paren-or-function-parameters:
2971 type-paren-or-function-parameters:
2710 - match: \(
2972 - match: \(
2711 captures:
2973 captures:
@@ -2716,7 +2978,6 @@ contexts:
2716 captures:
2978 captures:
2717 0: meta.brace.round.ts
2979 0: meta.brace.round.ts
2718 pop: true
2980 pop: true
2719− - include: destructuring-parameter
2720 - match: |-
2981 - match: |-
2721 (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s*(\??)(?=\s*(:\s*(
2982 (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s*(\??)(?=\s*(:\s*(
2722 (<) |
2983 (<) |
@@ -2729,7 +2990,8 @@ contexts:
2729 ))
2990 ))
2730 ))
2991 ))
2731 )) |
2992 )) |
2993+ (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
2732− (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$))))
2994+ (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))))
2733 captures:
2995 captures:
2734 1: storage.modifier.ts
2996 1: storage.modifier.ts
2735 2: keyword.operator.rest.ts
2997 2: keyword.operator.rest.ts
@@ -2748,10 +3010,23 @@ contexts:
2748 scope: punctuation.separator.parameter.ts
3010 scope: punctuation.separator.parameter.ts
2749 - include: type
3011 - include: type
2750 type-predicate-operator:
3012 type-predicate-operator:
3013+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(asserts)\s+)?(?!asserts)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s(is)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3014+ captures:
3015+ 1: keyword.operator.type.asserts.ts
3016+ 2: variable.parameter.ts variable.language.this.ts
3017+ 3: variable.parameter.ts
3018+ 4: keyword.operator.expression.is.ts
3019+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(asserts)\s+(?!is)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3020+ captures:
3021+ 1: keyword.operator.type.asserts.ts
3022+ 2: variable.parameter.ts variable.language.this.ts
3023+ 3: variable.parameter.ts
3024+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))asserts(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3025+ scope: keyword.operator.type.asserts.ts
2751 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))is(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3026 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))is(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2752 scope: keyword.operator.expression.is.ts
3027 scope: keyword.operator.expression.is.ts
2753 type-primitive:
3028 type-primitive:
2754− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(string|number|boolean|symbol|any|void|never)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3029+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(string|number|bigint|boolean|symbol|any|void|never|unknown)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2755 scope: support.type.primitive.ts
3030 scope: support.type.primitive.ts
2756 type-tuple:
3031 type-tuple:
2757 - match: '\['
3032 - match: '\['
@@ -2772,47 +3047,63 @@ contexts:
2772 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))undefined(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3047 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))undefined(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2773 scope: constant.language.undefined.ts
3048 scope: constant.language.undefined.ts
2774 var-expr:
3049 var-expr:
2775− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3050+ - match: '(?=(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))'
2776− captures:
2777− 1: keyword.control.export.ts
2778− 2: storage.type.ts
2779 push:
3051 push:
2780 - meta_scope: meta.var.expr.ts
3052 - meta_scope: meta.var.expr.ts
2781− - match: '((?=;|}|(\s+(of|in)\s+)|^\s*$|;|^\s*abstract\b|^\s*async\b|^\s*class\b|^\s*const\b|^\s*declare\b|^\s*enum\b|^\s*export\b|^\s*function\b|^\s*import\b|^\s*interface\b|^\s*let\b|^\s*module\b|^\s*namespace\b|^\s*return\b|^\s*type\b|^\s*var\b)|((?<=\S)(?<!^let|[^\._$[:alnum:]]let|^var|[^\._$[:alnum:]]var)(?=\s*$)))'
3053+ - match: '(?!(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|^\s*$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|((?<!^let|[^\._$[:alnum:]]let|^var|[^\._$[:alnum:]]var)(?=\s*$)))'
2782 pop: true
3054 pop: true
3055+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
3056+ captures:
3057+ 1: keyword.control.export.ts
3058+ 2: storage.modifier.ts
3059+ 3: storage.type.ts
3060+ push:
3061+ - match: (?=\S)
3062+ pop: true
2783 - include: destructuring-variable
3063 - include: destructuring-variable
2784 - include: var-single-variable
3064 - include: var-single-variable
2785 - include: variable-initializer
3065 - include: variable-initializer
2786 - include: comment
3066 - include: comment
2787− - match: (,)\s*(?!\S)
3067+ - match: (,)\s*((?!\S)|(?=\/\/))
2788 captures:
3068 captures:
2789 1: punctuation.separator.comma.ts
3069 1: punctuation.separator.comma.ts
2790 push:
3070 push:
2791− - match: '(?<!,)(((?==|;|}|(\s+(of|in)\s+)|^\s*$))|((?<=\S)(?=\s*$)))'
3071+ - match: '(?<!,)(((?==|;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|^\s*$))|((?<=\S)(?=\s*$)))'
2792 pop: true
3072 pop: true
3073+ - include: single-line-comment-consuming-line-ending
2793 - include: comment
3074 - include: comment
2794 - include: destructuring-variable
3075 - include: destructuring-variable
2795 - include: var-single-variable
3076 - include: var-single-variable
2796 - include: punctuation-comma
3077 - include: punctuation-comma
2797 - include: punctuation-comma
3078 - include: punctuation-comma
2798− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3079+ - match: '(?=(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))'
2799 captures:
3080 captures:
2800 1: keyword.control.export.ts
3081 1: keyword.control.export.ts
2801− 2: storage.type.ts
3082+ 2: storage.modifier.ts
3083+ 3: storage.type.ts
2802 push:
3084 push:
2803 - meta_scope: meta.var.expr.ts
3085 - meta_scope: meta.var.expr.ts
2804− - match: '((?=;|}|(\s+(of|in)\s+)|^\s*$|;|^\s*abstract\b|^\s*async\b|^\s*class\b|^\s*const\b|^\s*declare\b|^\s*enum\b|^\s*export\b|^\s*function\b|^\s*import\b|^\s*interface\b|^\s*let\b|^\s*module\b|^\s*namespace\b|^\s*return\b|^\s*type\b|^\s*var\b)|((?<=\S)(?<!^const|[^\._$[:alnum:]]const)(?=\s*$)))'
3086+ - match: '(?!(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|^\s*$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|((?<!^const|[^\._$[:alnum:]]const)(?=\s*$)))'
2805 pop: true
3087 pop: true
3088+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
3089+ captures:
3090+ 1: keyword.control.export.ts
3091+ 2: storage.modifier.ts
3092+ 3: storage.type.ts
3093+ push:
3094+ - match: (?=\S)
3095+ pop: true
2806 - include: destructuring-const
3096 - include: destructuring-const
2807 - include: var-single-const
3097 - include: var-single-const
2808 - include: variable-initializer
3098 - include: variable-initializer
2809 - include: comment
3099 - include: comment
2810− - match: (,)\s*(?!\S)
3100+ - match: (,)\s*((?!\S)|(?=\/\/))
2811 captures:
3101 captures:
2812 1: punctuation.separator.comma.ts
3102 1: punctuation.separator.comma.ts
2813 push:
3103 push:
2814− - match: '(?<!,)(((?==|;|}|(\s+(of|in)\s+)|^\s*$))|((?<=\S)(?=\s*$)))'
3104+ - match: '(?<!,)(((?==|;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|^\s*$))|((?<=\S)(?=\s*$)))'
2815 pop: true
3105 pop: true
3106+ - include: single-line-comment-consuming-line-ending
2816 - include: comment
3107 - include: comment
2817 - include: destructuring-const
3108 - include: destructuring-const
2818 - include: var-single-const
3109 - include: var-single-const
@@ -2829,24 +3120,22 @@ contexts:
2829 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3120 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
2830 )) |
3121 )) |
2831 ((async\s*)?(
3122 ((async\s*)?(
2832− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
3123+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
2833 # sure shot arrow functions even if => is on new line
3124 # sure shot arrow functions even if => is on new line
2834 (
3125 (
2835− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
3126+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
2836− [(]\s*
3127+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
2837 (
3128 (
2838 ([)]\s*:) | # ():
3129 ([)]\s*:) | # ():
2839 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3130 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
2840 )
3131 )
2841 ) |
3132 ) |
2842− (
3133+
2843− [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
2844− ) |
2845 # arrow function possible to detect only with => on same line
3134 # arrow function possible to detect only with => on same line
2846 (
3135 (
2847− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
3136+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
2848− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3137+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
2849− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
3138+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
2850 \s*=> # arrow operator
3139 \s*=> # arrow operator
2851 )
3140 )
2852 ))
3141 ))
@@ -2863,7 +3152,8 @@ contexts:
2863 ))
3152 ))
2864 ))
3153 ))
2865 )) |
3154 )) |
3155+ (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
2866− (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$))) |
3156+ (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
2867 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
3157 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
2868 ((async\s+)?(
3158 ((async\s+)?(
2869 (function\s*[(<*]) |
3159 (function\s*[(<*]) |
@@ -2871,24 +3161,22 @@ contexts:
2871 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3161 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
2872 )) |
3162 )) |
2873 ((async\s*)?(
3163 ((async\s*)?(
2874− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
3164+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
2875 # sure shot arrow functions even if => is on new line
3165 # sure shot arrow functions even if => is on new line
2876 (
3166 (
2877− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
3167+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
2878− [(]\s*
3168+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
2879 (
3169 (
2880 ([)]\s*:) | # ():
3170 ([)]\s*:) | # ():
2881 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3171 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
2882 )
3172 )
2883 ) |
3173 ) |
2884− (
3174+
2885− [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
2886− ) |
2887 # arrow function possible to detect only with => on same line
3175 # arrow function possible to detect only with => on same line
2888 (
3176 (
2889− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
3177+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
2890− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3178+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
2891− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
3179+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
2892 \s*=> # arrow operator
3180 \s*=> # arrow operator
2893 )
3181 )
2894 ))
3182 ))
@@ -2897,7 +3185,7 @@ contexts:
2897 1: meta.definition.variable.ts variable.other.constant.ts entity.name.function.ts
3185 1: meta.definition.variable.ts variable.other.constant.ts entity.name.function.ts
2898 push:
3186 push:
2899 - meta_scope: meta.var-single-variable.expr.ts
3187 - meta_scope: meta.var-single-variable.expr.ts
2900− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
3188+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
2901 pop: true
3189 pop: true
2902 - include: var-single-variable-type-annotation
3190 - include: var-single-variable-type-annotation
2903 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
3191 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
@@ -2905,12 +3193,12 @@ contexts:
2905 1: meta.definition.variable.ts variable.other.constant.ts
3193 1: meta.definition.variable.ts variable.other.constant.ts
2906 push:
3194 push:
2907 - meta_scope: meta.var-single-variable.expr.ts
3195 - meta_scope: meta.var-single-variable.expr.ts
2908− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
3196+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
2909 pop: true
3197 pop: true
2910 - include: var-single-variable-type-annotation
3198 - include: var-single-variable-type-annotation
2911 var-single-variable:
3199 var-single-variable:
2912 - match: |-
3200 - match: |-
2913− (?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\s*
3201+ (?x)([_$[:alpha:]][_$[:alnum:]]*)(\!)?(?=\s*
2914 # function assignment |
3202 # function assignment |
2915 (=\s*(
3203 (=\s*(
2916 ((async\s+)?(
3204 ((async\s+)?(
@@ -2919,24 +3207,22 @@ contexts:
2919 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3207 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
2920 )) |
3208 )) |
2921 ((async\s*)?(
3209 ((async\s*)?(
2922− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
3210+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
2923 # sure shot arrow functions even if => is on new line
3211 # sure shot arrow functions even if => is on new line
2924 (
3212 (
2925− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
3213+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
2926− [(]\s*
3214+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
2927 (
3215 (
2928 ([)]\s*:) | # ():
3216 ([)]\s*:) | # ():
2929 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3217 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
2930 )
3218 )
2931 ) |
3219 ) |
2932− (
3220+
2933− [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
2934− ) |
2935 # arrow function possible to detect only with => on same line
3221 # arrow function possible to detect only with => on same line
2936 (
3222 (
2937− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
3223+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
2938− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3224+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
2939− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
3225+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
2940 \s*=> # arrow operator
3226 \s*=> # arrow operator
2941 )
3227 )
2942 ))
3228 ))
@@ -2953,7 +3239,8 @@ contexts:
2953 ))
3239 ))
2954 ))
3240 ))
2955 )) |
3241 )) |
3242+ (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
2956− (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$))) |
3243+ (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
2957 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
3244 (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
2958 ((async\s+)?(
3245 ((async\s+)?(
2959 (function\s*[(<*]) |
3246 (function\s*[(<*]) |
@@ -2961,49 +3248,50 @@ contexts:
2961 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3248 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
2962 )) |
3249 )) |
2963 ((async\s*)?(
3250 ((async\s*)?(
2964− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?[\(]\s*([\{\[]\s*)?$)) |
3251+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
2965 # sure shot arrow functions even if => is on new line
3252 # sure shot arrow functions even if => is on new line
2966 (
3253 (
2967− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
3254+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
2968− [(]\s*
3255+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
2969 (
3256 (
2970 ([)]\s*:) | # ():
3257 ([)]\s*:) | # ():
2971 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3258 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
2972 )
3259 )
2973 ) |
3260 ) |
2974− (
3261+
2975− [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
2976− ) |
2977 # arrow function possible to detect only with => on same line
3262 # arrow function possible to detect only with => on same line
2978 (
3263 (
2979− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
3264+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
2980− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3265+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
2981− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
3266+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
2982 \s*=> # arrow operator
3267 \s*=> # arrow operator
2983 )
3268 )
2984 ))
3269 ))
2985 )))
3270 )))
2986 captures:
3271 captures:
2987 1: meta.definition.variable.ts entity.name.function.ts
3272 1: meta.definition.variable.ts entity.name.function.ts
3273+ 2: keyword.operator.definiteassignment.ts
2988 push:
3274 push:
2989 - meta_scope: meta.var-single-variable.expr.ts
3275 - meta_scope: meta.var-single-variable.expr.ts
2990− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
3276+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
2991 pop: true
3277 pop: true
2992 - include: var-single-variable-type-annotation
3278 - include: var-single-variable-type-annotation
2993− - match: "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])"
3279+ - match: '([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])(\!)?'
2994 captures:
3280 captures:
2995 1: meta.definition.variable.ts variable.other.constant.ts
3281 1: meta.definition.variable.ts variable.other.constant.ts
3282+ 2: keyword.operator.definiteassignment.ts
2996 push:
3283 push:
2997 - meta_scope: meta.var-single-variable.expr.ts
3284 - meta_scope: meta.var-single-variable.expr.ts
2998− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
3285+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
2999 pop: true
3286 pop: true
3000 - include: var-single-variable-type-annotation
3287 - include: var-single-variable-type-annotation
3001− - match: "([_$[:alpha:]][_$[:alnum:]]*)"
3288+ - match: '([_$[:alpha:]][_$[:alnum:]]*)(\!)?'
3002 captures:
3289 captures:
3003 1: meta.definition.variable.ts variable.other.readwrite.ts
3290 1: meta.definition.variable.ts variable.other.readwrite.ts
3291+ 2: keyword.operator.definiteassignment.ts
3004 push:
3292 push:
3005 - meta_scope: meta.var-single-variable.expr.ts
3293 - meta_scope: meta.var-single-variable.expr.ts
3006− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
3294+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3007 pop: true
3295 pop: true
3008 - include: var-single-variable-type-annotation
3296 - include: var-single-variable-type-annotation
3009 var-single-variable-type-annotation:
3297 var-single-variable-type-annotation:
@@ -3011,17 +3299,17 @@ contexts:
3011 - include: string
3299 - include: string
3012 - include: comment
3300 - include: comment
3013 variable-initializer:
3301 variable-initializer:
3014− - match: (?<!=|!)(=)(?!=)(?=\s*\S)
3302+ - match: (?<!=|!)(=)(?!=)(?=\s*\S)(?!\s*.*=>\s*$)
3015 captures:
3303 captures:
3016 1: keyword.operator.assignment.ts
3304 1: keyword.operator.assignment.ts
3017 push:
3305 push:
3018− - match: '(?=$|^|[,);}\]])'
3306+ - match: '(?=$|^|[,);}\]]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3019 pop: true
3307 pop: true
3020 - include: expression
3308 - include: expression
3021 - match: (?<!=|!)(=)(?!=)
3309 - match: (?<!=|!)(=)(?!=)
3022 captures:
3310 captures:
3023 1: keyword.operator.assignment.ts
3311 1: keyword.operator.assignment.ts
3024 push:
3312 push:
3025− - match: '(?=[,);}\]])|(?=^\s*$)|(?<=\S)(?<!=)(?=\s*$)'
3313+ - match: '(?=[,);}\]]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))|(?=^\s*$)|(?<=\S)(?<!=)(?=\s*$)'
3026 pop: true
3314 pop: true
3027 - include: expression
3315 - include: expression