-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
source.ts.js
3423 lines (3421 loc) · 240 KB
/
source.ts.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/Microsoft/TypeScript-TmLanguage>
// and licensed `mit`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: ['.ts', '.cts', '.mts'],
names: ['typescript', 'ts'],
patterns: [
{include: '#directives'},
{include: '#statements'},
{include: '#shebang'}
],
repository: {
'access-modifier': {
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(abstract|declare|override|public|protected|private|readonly|static)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'storage.modifier.ts'
},
'after-operator-block-as-object-literal': {
begin:
'(?<!\\+\\+|--)(?<=[:=(,\\[?+!>]|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^yield|[^\\._$[:alnum:]]yield|^throw|[^\\._$[:alnum:]]throw|^in|[^\\._$[:alnum:]]in|^of|[^\\._$[:alnum:]]of|^typeof|[^\\._$[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)',
beginCaptures: {1: {name: 'punctuation.definition.block.ts'}},
end: '\\}',
endCaptures: {0: {name: 'punctuation.definition.block.ts'}},
name: 'meta.objectliteral.ts',
patterns: [{include: '#object-member'}]
},
'array-binding-pattern': {
begin: '(?:(\\.\\.\\.)\\s*)?(\\[)',
beginCaptures: {
1: {name: 'keyword.operator.rest.ts'},
2: {name: 'punctuation.definition.binding-pattern.array.ts'}
},
end: '\\]',
endCaptures: {
0: {name: 'punctuation.definition.binding-pattern.array.ts'}
},
patterns: [{include: '#binding-element'}, {include: '#punctuation-comma'}]
},
'array-binding-pattern-const': {
begin: '(?:(\\.\\.\\.)\\s*)?(\\[)',
beginCaptures: {
1: {name: 'keyword.operator.rest.ts'},
2: {name: 'punctuation.definition.binding-pattern.array.ts'}
},
end: '\\]',
endCaptures: {
0: {name: 'punctuation.definition.binding-pattern.array.ts'}
},
patterns: [
{include: '#binding-element-const'},
{include: '#punctuation-comma'}
]
},
'array-literal': {
begin: '\\s*(\\[)',
beginCaptures: {1: {name: 'meta.brace.square.ts'}},
end: '\\]',
endCaptures: {0: {name: 'meta.brace.square.ts'}},
name: 'meta.array.literal.ts',
patterns: [{include: '#expression'}, {include: '#punctuation-comma'}]
},
'arrow-function': {
patterns: [
{
captures: {
1: {name: 'storage.modifier.async.ts'},
2: {name: 'variable.parameter.ts'}
},
match:
'(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(\\basync)\\s+)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(?==>)',
name: 'meta.arrow.ts'
},
{
begin:
'(?x) (?:\n (?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(\\basync)\n)? ((?<![})!\\]])\\s*\n (?=\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\\'\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\\'([^\\\'\\\\]|\\\\.)*\\\')|(\\"([^\\"\\\\]|\\\\.)*\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n )\n)',
beginCaptures: {1: {name: 'storage.modifier.async.ts'}},
end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)\\b)|const|import|enum|namespace|module|type|abstract|declare)\\s+))',
name: 'meta.arrow.ts',
patterns: [
{include: '#comment'},
{include: '#type-parameters'},
{include: '#function-parameters'},
{include: '#arrow-return-type'},
{include: '#possibly-arrow-return-type'}
]
},
{
begin: '=>',
beginCaptures: {0: {name: 'storage.type.function.arrow.ts'}},
end: '((?<=\\}|\\S)(?<!=>)|((?!\\{)(?=\\S)))(?!\\/[\\/\\*])',
name: 'meta.arrow.ts',
patterns: [
{include: '#single-line-comment-consuming-line-ending'},
{include: '#decl-block'},
{include: '#expression'}
]
}
]
},
'arrow-return-type': {
begin: '(?<=\\))\\s*(:)',
beginCaptures: {1: {name: 'keyword.operator.type.annotation.ts'}},
end: '(?==>|\\{|(^\\s*(export|function|class|interface|let|var|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)\\b)|const|import|enum|namespace|module|type|abstract|declare)\\s+))',
name: 'meta.return.type.arrow.ts',
patterns: [{include: '#arrow-return-type-body'}]
},
'arrow-return-type-body': {
patterns: [
{
begin: '(?<=[:])(?=\\s*\\{)',
end: '(?<=\\})',
patterns: [{include: '#type-object'}]
},
{include: '#type-predicate-operator'},
{include: '#type'}
]
},
'async-modifier': {
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(async)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'storage.modifier.async.ts'
},
'binding-element': {
patterns: [
{include: '#comment'},
{include: '#string'},
{include: '#numeric-literal'},
{include: '#regex'},
{include: '#object-binding-pattern'},
{include: '#array-binding-pattern'},
{include: '#destructuring-variable-rest'},
{include: '#variable-initializer'}
]
},
'binding-element-const': {
patterns: [
{include: '#comment'},
{include: '#string'},
{include: '#numeric-literal'},
{include: '#regex'},
{include: '#object-binding-pattern-const'},
{include: '#array-binding-pattern-const'},
{include: '#destructuring-variable-rest-const'},
{include: '#variable-initializer'}
]
},
'boolean-literal': {
patterns: [
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))true(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'constant.language.boolean.true.ts'
},
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))false(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'constant.language.boolean.false.ts'
}
]
},
brackets: {
patterns: [
{begin: '{', end: '}|(?=\\*/)', patterns: [{include: '#brackets'}]},
{begin: '\\[', end: '\\]|(?=\\*/)', patterns: [{include: '#brackets'}]}
]
},
cast: {
patterns: [
{
captures: {
1: {name: 'meta.brace.angle.ts'},
2: {name: 'storage.modifier.ts'},
3: {name: 'meta.brace.angle.ts'}
},
match: '\\s*(<)\\s*(const)\\s*(>)',
name: 'cast.expr.ts'
},
{
begin:
'(?:(?<!\\+\\+|--)(?<=^return|[^\\._$[:alnum:]]return|^throw|[^\\._$[:alnum:]]throw|^yield|[^\\._$[:alnum:]]yield|^await|[^\\._$[:alnum:]]await|^default|[^\\._$[:alnum:]]default|[=(,:>*?\\&\\|\\^]|[^_$[:alnum:]](?:\\+\\+|\\-\\-)|[^\\+]\\+|[^\\-]\\-))\\s*(<)(?!<?\\=)(?!\\s*$)',
beginCaptures: {1: {name: 'meta.brace.angle.ts'}},
end: '(\\>)',
endCaptures: {1: {name: 'meta.brace.angle.ts'}},
name: 'cast.expr.ts',
patterns: [{include: '#type'}]
},
{
begin: '(?:(?<=^))\\s*(<)(?=[_$[:alpha:]][_$[:alnum:]]*\\s*>)',
beginCaptures: {1: {name: 'meta.brace.angle.ts'}},
end: '(\\>)',
endCaptures: {1: {name: 'meta.brace.angle.ts'}},
name: 'cast.expr.ts',
patterns: [{include: '#type'}]
}
]
},
'class-declaration': {
begin:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?\\b(?:(abstract)\\s+)?\\b(class)\\b(?=\\s+|/[/*])',
beginCaptures: {
1: {name: 'keyword.control.export.ts'},
2: {name: 'storage.modifier.ts'},
3: {name: 'storage.modifier.ts'},
4: {name: 'storage.type.class.ts'}
},
end: '(?<=\\})',
name: 'meta.class.ts',
patterns: [{include: '#class-declaration-or-expression-patterns'}]
},
'class-declaration-or-expression-patterns': {
patterns: [
{include: '#comment'},
{include: '#class-or-interface-heritage'},
{
captures: {0: {name: 'entity.name.type.class.ts'}},
match: '[_$[:alpha:]][_$[:alnum:]]*'
},
{include: '#type-parameters'},
{include: '#class-or-interface-body'}
]
},
'class-expression': {
begin:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(abstract)\\s+)?(class)\\b(?=\\s+|[<{]|\\/[\\/*])',
beginCaptures: {
1: {name: 'storage.modifier.ts'},
2: {name: 'storage.type.class.ts'}
},
end: '(?<=\\})',
name: 'meta.class.ts',
patterns: [{include: '#class-declaration-or-expression-patterns'}]
},
'class-or-interface-body': {
begin: '\\{',
beginCaptures: {0: {name: 'punctuation.definition.block.ts'}},
end: '\\}',
endCaptures: {0: {name: 'punctuation.definition.block.ts'}},
patterns: [
{include: '#comment'},
{include: '#decorator'},
{
begin: '(?<=:)\\s*',
end: '(?=\\s|[;),}\\]:\\-\\+]|;|^\\s*$|(?:^\\s*(?:abstract|async|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)\\b)|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)|var|while)\\b))',
patterns: [{include: '#expression'}]
},
{include: '#method-declaration'},
{include: '#indexer-declaration'},
{include: '#field-declaration'},
{include: '#string'},
{include: '#type-annotation'},
{include: '#variable-initializer'},
{include: '#access-modifier'},
{include: '#property-accessor'},
{include: '#async-modifier'},
{include: '#after-operator-block-as-object-literal'},
{include: '#decl-block'},
{include: '#expression'},
{include: '#punctuation-comma'},
{include: '#punctuation-semicolon'}
]
},
'class-or-interface-heritage': {
begin:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:\\b(extends|implements)\\b)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
beginCaptures: {1: {name: 'storage.modifier.ts'}},
end: '(?=\\{)',
patterns: [
{include: '#comment'},
{include: '#class-or-interface-heritage'},
{include: '#type-parameters'},
{include: '#expressionWithoutIdentifiers'},
{
captures: {
1: {name: 'entity.name.type.module.ts'},
2: {name: 'punctuation.accessor.ts'},
3: {name: 'punctuation.accessor.optional.ts'}
},
match:
'([_$[:alpha:]][_$[:alnum:]]*)\\s*(?:(\\.)|(\\?\\.(?!\\s*[[:digit:]])))(?=\\s*[_$[:alpha:]][_$[:alnum:]]*(\\s*\\??\\.\\s*[_$[:alpha:]][_$[:alnum:]]*)*\\s*)'
},
{
captures: {1: {name: 'entity.other.inherited-class.ts'}},
match: '([_$[:alpha:]][_$[:alnum:]]*)'
},
{include: '#expressionPunctuations'}
]
},
comment: {
patterns: [
{
begin: '/\\*\\*(?!/)',
beginCaptures: {0: {name: 'punctuation.definition.comment.ts'}},
end: '\\*/',
endCaptures: {0: {name: 'punctuation.definition.comment.ts'}},
name: 'comment.block.documentation.ts',
patterns: [{include: '#docblock'}]
},
{
begin: '(/\\*)(?:\\s*((@)internal)(?=\\s|(\\*/)))?',
beginCaptures: {
1: {name: 'punctuation.definition.comment.ts'},
2: {name: 'storage.type.internaldeclaration.ts'},
3: {name: 'punctuation.decorator.internaldeclaration.ts'}
},
end: '\\*/',
endCaptures: {0: {name: 'punctuation.definition.comment.ts'}},
name: 'comment.block.ts'
},
{
begin: '(^[ \\t]+)?((//)(?:\\s*((@)internal)(?=\\s|$))?)',
beginCaptures: {
1: {name: 'punctuation.whitespace.comment.leading.ts'},
2: {name: 'comment.line.double-slash.ts'},
3: {name: 'punctuation.definition.comment.ts'},
4: {name: 'storage.type.internaldeclaration.ts'},
5: {name: 'punctuation.decorator.internaldeclaration.ts'}
},
contentName: 'comment.line.double-slash.ts',
end: '(?=$)'
}
]
},
'control-statement': {
patterns: [
{include: '#switch-statement'},
{include: '#for-loop'},
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(catch|finally|throw|try)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'keyword.control.trycatch.ts'
},
{
captures: {
1: {name: 'keyword.control.loop.ts'},
2: {name: 'entity.name.label.ts'}
},
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(break|continue|goto)\\s+([_$[:alpha:]][_$[:alnum:]]*)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))'
},
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(break|continue|do|goto|while)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'keyword.control.loop.ts'
},
{
begin:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(return)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
beginCaptures: {0: {name: 'keyword.control.flow.ts'}},
end: '(?=[;}]|$|;|^\\s*$|(?:^\\s*(?:abstract|async|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)\\b)|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)|var|while)\\b))',
patterns: [{include: '#expression'}]
},
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(case|default|switch)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'keyword.control.switch.ts'
},
{include: '#if-statement'},
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(else|if)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'keyword.control.conditional.ts'
},
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(with)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'keyword.control.with.ts'
},
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(package)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'keyword.control.ts'
},
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(debugger)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'keyword.other.debugger.ts'
}
]
},
'decl-block': {
begin: '\\{',
beginCaptures: {0: {name: 'punctuation.definition.block.ts'}},
end: '\\}',
endCaptures: {0: {name: 'punctuation.definition.block.ts'}},
name: 'meta.block.ts',
patterns: [{include: '#statements'}]
},
declaration: {
patterns: [
{include: '#decorator'},
{include: '#var-expr'},
{include: '#function-declaration'},
{include: '#class-declaration'},
{include: '#interface-declaration'},
{include: '#enum-declaration'},
{include: '#namespace-declaration'},
{include: '#type-alias-declaration'},
{include: '#import-equals-declaration'},
{include: '#import-declaration'},
{include: '#export-declaration'},
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(declare|export)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'storage.modifier.ts'
}
]
},
decorator: {
begin: '(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))\\@',
beginCaptures: {0: {name: 'punctuation.decorator.ts'}},
end: '(?=\\s)',
name: 'meta.decorator.ts',
patterns: [{include: '#expression'}]
},
'destructuring-const': {
patterns: [
{
begin:
'(?<!=|:|^of|[^\\._$[:alnum:]]of|^in|[^\\._$[:alnum:]]in)\\s*(?=\\{)',
end: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))',
name: 'meta.object-binding-pattern-variable.ts',
patterns: [
{include: '#object-binding-pattern-const'},
{include: '#type-annotation'},
{include: '#comment'}
]
},
{
begin:
'(?<!=|:|^of|[^\\._$[:alnum:]]of|^in|[^\\._$[:alnum:]]in)\\s*(?=\\[)',
end: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))',
name: 'meta.array-binding-pattern-variable.ts',
patterns: [
{include: '#array-binding-pattern-const'},
{include: '#type-annotation'},
{include: '#comment'}
]
}
]
},
'destructuring-parameter': {
patterns: [
{
begin: '(?<!=|:)\\s*(?:(\\.\\.\\.)\\s*)?(\\{)',
beginCaptures: {
1: {name: 'keyword.operator.rest.ts'},
2: {name: 'punctuation.definition.binding-pattern.object.ts'}
},
end: '\\}',
endCaptures: {
0: {name: 'punctuation.definition.binding-pattern.object.ts'}
},
name: 'meta.parameter.object-binding-pattern.ts',
patterns: [{include: '#parameter-object-binding-element'}]
},
{
begin: '(?<!=|:)\\s*(?:(\\.\\.\\.)\\s*)?(\\[)',
beginCaptures: {
1: {name: 'keyword.operator.rest.ts'},
2: {name: 'punctuation.definition.binding-pattern.array.ts'}
},
end: '\\]',
endCaptures: {
0: {name: 'punctuation.definition.binding-pattern.array.ts'}
},
name: 'meta.paramter.array-binding-pattern.ts',
patterns: [
{include: '#parameter-binding-element'},
{include: '#punctuation-comma'}
]
}
]
},
'destructuring-parameter-rest': {
captures: {
1: {name: 'keyword.operator.rest.ts'},
2: {name: 'variable.parameter.ts'}
},
match: '(?:(\\.\\.\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)'
},
'destructuring-variable': {
patterns: [
{
begin:
'(?<!=|:|^of|[^\\._$[:alnum:]]of|^in|[^\\._$[:alnum:]]in)\\s*(?=\\{)',
end: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))',
name: 'meta.object-binding-pattern-variable.ts',
patterns: [
{include: '#object-binding-pattern'},
{include: '#type-annotation'},
{include: '#comment'}
]
},
{
begin:
'(?<!=|:|^of|[^\\._$[:alnum:]]of|^in|[^\\._$[:alnum:]]in)\\s*(?=\\[)',
end: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(of|in)\\s+))',
name: 'meta.array-binding-pattern-variable.ts',
patterns: [
{include: '#array-binding-pattern'},
{include: '#type-annotation'},
{include: '#comment'}
]
}
]
},
'destructuring-variable-rest': {
captures: {
1: {name: 'keyword.operator.rest.ts'},
2: {name: 'meta.definition.variable.ts variable.other.readwrite.ts'}
},
match: '(?:(\\.\\.\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)'
},
'destructuring-variable-rest-const': {
captures: {
1: {name: 'keyword.operator.rest.ts'},
2: {name: 'meta.definition.variable.ts variable.other.constant.ts'}
},
match: '(?:(\\.\\.\\.)\\s*)?([_$[:alpha:]][_$[:alnum:]]*)'
},
directives: {
begin:
'^(///)\\s*(?=<(reference|amd-dependency|amd-module)(\\s+(path|types|no-default-lib|lib|name|resolution-mode)\\s*=\\s*((\\\'([^\\\'\\\\]|\\\\.)*\\\')|(\\"([^\\"\\\\]|\\\\.)*\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)))+\\s*/>\\s*$)',
beginCaptures: {1: {name: 'punctuation.definition.comment.ts'}},
end: '(?=$)',
name: 'comment.line.triple-slash.directive.ts',
patterns: [
{
begin: '(<)(reference|amd-dependency|amd-module)',
beginCaptures: {
1: {name: 'punctuation.definition.tag.directive.ts'},
2: {name: 'entity.name.tag.directive.ts'}
},
end: '/>',
endCaptures: {0: {name: 'punctuation.definition.tag.directive.ts'}},
name: 'meta.tag.ts',
patterns: [
{
match: 'path|types|no-default-lib|lib|name|resolution-mode',
name: 'entity.other.attribute-name.directive.ts'
},
{match: '=', name: 'keyword.operator.assignment.ts'},
{include: '#string'}
]
}
]
},
docblock: {
patterns: [
{
captures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'},
3: {name: 'constant.language.access-type.jsdoc'}
},
match:
'(?x)\n((@)(?:access|api))\n\\s+\n(private|protected|public)\n\\b'
},
{
captures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'},
3: {name: 'entity.name.type.instance.jsdoc'},
4: {name: 'punctuation.definition.bracket.angle.begin.jsdoc'},
5: {name: 'constant.other.email.link.underline.jsdoc'},
6: {name: 'punctuation.definition.bracket.angle.end.jsdoc'}
},
match:
'(?x)\n((@)author)\n\\s+\n(\n [^@\\s<>*/]\n (?:[^@<>*/]|\\*[^/])*\n)\n(?:\n \\s*\n (<)\n ([^>\\s]+)\n (>)\n)?'
},
{
captures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'},
3: {name: 'entity.name.type.instance.jsdoc'},
4: {name: 'keyword.operator.control.jsdoc'},
5: {name: 'entity.name.type.instance.jsdoc'}
},
match:
'(?x)\n((@)borrows) \\s+\n((?:[^@\\s*/]|\\*[^/])+) # <that namepath>\n\\s+ (as) \\s+ # as\n((?:[^@\\s*/]|\\*[^/])+) # <this namepath>'
},
{
begin: '((@)example)\\s+',
beginCaptures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'}
},
end: '(?=@|\\*/)',
name: 'meta.example.jsdoc',
patterns: [
{match: '^\\s\\*\\s+'},
{
begin: '\\G(<)caption(>)',
beginCaptures: {
0: {name: 'entity.name.tag.inline.jsdoc'},
1: {name: 'punctuation.definition.bracket.angle.begin.jsdoc'},
2: {name: 'punctuation.definition.bracket.angle.end.jsdoc'}
},
contentName: 'constant.other.description.jsdoc',
end: '(</)caption(>)|(?=\\*/)',
endCaptures: {
0: {name: 'entity.name.tag.inline.jsdoc'},
1: {name: 'punctuation.definition.bracket.angle.begin.jsdoc'},
2: {name: 'punctuation.definition.bracket.angle.end.jsdoc'}
}
},
{
captures: {0: {name: 'source.embedded.ts'}},
match: '[^\\s@*](?:[^*]|\\*[^/])*'
}
]
},
{
captures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'},
3: {name: 'constant.language.symbol-type.jsdoc'}
},
match:
'(?x) ((@)kind) \\s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \\b'
},
{
captures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'},
3: {name: 'variable.other.link.underline.jsdoc'},
4: {name: 'entity.name.type.instance.jsdoc'}
},
match:
'(?x)\n((@)see)\n\\s+\n(?:\n # URL\n (\n (?=https?://)\n (?:[^\\s*]|\\*[^/])+\n )\n |\n # JSDoc namepath\n (\n (?!\n # Avoid matching bare URIs (also acceptable as links)\n https?://\n |\n # Avoid matching {@inline tags}; we match those below\n (?:\\[[^\\[\\]]*\\])? # Possible description [preceding]{@tag}\n {@(?:link|linkcode|linkplain|tutorial)\\b\n )\n # Matched namepath\n (?:[^@\\s*/]|\\*[^/])+\n )\n)'
},
{
captures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'},
3: {name: 'variable.other.jsdoc'}
},
match:
'(?x)\n((@)template)\n\\s+\n# One or more valid identifiers\n(\n [A-Za-z_$] # First character: non-numeric word character\n [\\w$.\\[\\]]* # Rest of identifier\n (?: # Possible list of additional identifiers\n \\s* , \\s*\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n )*\n)'
},
{
begin: '(?x)((@)template)\\s+(?={)',
beginCaptures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'}
},
end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])',
patterns: [
{include: '#jsdoctype'},
{match: '([A-Za-z_$][\\w$.\\[\\]]*)', name: 'variable.other.jsdoc'}
]
},
{
captures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'},
3: {name: 'variable.other.jsdoc'}
},
match:
'(?x)\n(\n (@)\n (?:arg|argument|const|constant|member|namespace|param|var)\n)\n\\s+\n(\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n)'
},
{
begin: '((@)typedef)\\s+(?={)',
beginCaptures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'}
},
end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])',
patterns: [
{include: '#jsdoctype'},
{
match: '(?:[^@\\s*/]|\\*[^/])+',
name: 'entity.name.type.instance.jsdoc'
}
]
},
{
begin:
'((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?={)',
beginCaptures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'}
},
end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])',
patterns: [
{include: '#jsdoctype'},
{match: '([A-Za-z_$][\\w$.\\[\\]]*)', name: 'variable.other.jsdoc'},
{
captures: {
1: {
name: 'punctuation.definition.optional-value.begin.bracket.square.jsdoc'
},
2: {name: 'keyword.operator.assignment.jsdoc'},
3: {name: 'source.embedded.ts'},
4: {
name: 'punctuation.definition.optional-value.end.bracket.square.jsdoc'
},
5: {name: 'invalid.illegal.syntax.jsdoc'}
},
match:
'(?x)\n(\\[)\\s*\n[\\w$]+\n(?:\n (?:\\[\\])? # Foo[ ].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [\\w$]+\n)*\n(?:\n \\s*\n (=) # [foo=bar] Default parameter value\n \\s*\n (\n # The inner regexes are to stop the match early at */ and to not stop at escaped quotes\n (?>\n "(?:(?:\\*(?!/))|(?:\\\\(?!"))|[^*\\\\])*?" | # [foo="bar"] Double-quoted\n \'(?:(?:\\*(?!/))|(?:\\\\(?!\'))|[^*\\\\])*?\' | # [foo=\'bar\'] Single-quoted\n \\[ (?:(?:\\*(?!/))|[^*])*? \\] | # [foo=[1,2]] Array literal\n (?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])* # Everything else\n )*\n )\n)?\n\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))',
name: 'variable.other.jsdoc'
}
]
},
{
begin:
'(?x)\n(\n (@)\n (?:define|enum|exception|export|extends|lends|implements|modifies\n |namespace|private|protected|returns?|satisfies|suppress|this|throws|type\n |yields?)\n)\n\\s+(?={)',
beginCaptures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'}
},
end: '(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])',
patterns: [{include: '#jsdoctype'}]
},
{
captures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'},
3: {name: 'entity.name.type.instance.jsdoc'}
},
match:
'(?x)\n(\n (@)\n (?:alias|augments|callback|constructs|emits|event|fires|exports?\n |extends|external|function|func|host|lends|listens|interface|memberof!?\n |method|module|mixes|mixin|name|requires|see|this|typedef|uses)\n)\n\\s+\n(\n (?:\n [^{}@\\s*] | \\*[^/]\n )+\n)'
},
{
begin: "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))",
beginCaptures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'},
3: {name: 'variable.other.jsdoc'},
4: {name: 'punctuation.definition.string.begin.jsdoc'}
},
contentName: 'variable.other.jsdoc',
end: '(\\3)|(?=$|\\*/)',
endCaptures: {
0: {name: 'variable.other.jsdoc'},
1: {name: 'punctuation.definition.string.end.jsdoc'}
}
},
{
captures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'},
3: {name: 'variable.other.jsdoc'}
},
match:
'((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)'
},
{
captures: {1: {name: 'punctuation.definition.block.tag.jsdoc'}},
match:
'(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \\b',
name: 'storage.type.class.jsdoc'
},
{include: '#inline-tags'},
{
captures: {
1: {name: 'storage.type.class.jsdoc'},
2: {name: 'punctuation.definition.block.tag.jsdoc'}
},
match: '((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\\s+)'
}
]
},
'enum-declaration': {
begin:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?(?:\\b(const)\\s+)?\\b(enum)\\s+([_$[:alpha:]][_$[:alnum:]]*)',
beginCaptures: {
1: {name: 'keyword.control.export.ts'},
2: {name: 'storage.modifier.ts'},
3: {name: 'storage.modifier.ts'},
4: {name: 'storage.type.enum.ts'},
5: {name: 'entity.name.type.enum.ts'}
},
end: '(?<=\\})',
name: 'meta.enum.declaration.ts',
patterns: [
{include: '#comment'},
{
begin: '\\{',
beginCaptures: {0: {name: 'punctuation.definition.block.ts'}},
end: '\\}',
endCaptures: {0: {name: 'punctuation.definition.block.ts'}},
patterns: [
{include: '#comment'},
{
begin: '([_$[:alpha:]][_$[:alnum:]]*)',
beginCaptures: {0: {name: 'variable.other.enummember.ts'}},
end: '(?=,|\\}|$)',
patterns: [
{include: '#comment'},
{include: '#variable-initializer'}
]
},
{
begin:
'(?=((\\\'([^\\\'\\\\]|\\\\.)*\\\')|(\\"([^\\"\\\\]|\\\\.)*\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])+\\])))',
end: '(?=,|\\}|$)',
patterns: [
{include: '#string'},
{include: '#array-literal'},
{include: '#comment'},
{include: '#variable-initializer'}
]
},
{include: '#punctuation-comma'}
]
}
]
},
'export-declaration': {
patterns: [
{
captures: {
1: {name: 'keyword.control.export.ts'},
2: {name: 'keyword.control.as.ts'},
3: {name: 'storage.type.namespace.ts'},
4: {name: 'entity.name.type.module.ts'}
},
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(export)\\s+(as)\\s+(namespace)\\s+([_$[:alpha:]][_$[:alnum:]]*)'
},
{
begin:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(export)(?:\\s+(type))?(?:(?:\\s*(=))|(?:\\s+(default)(?=\\s+)))',
beginCaptures: {
1: {name: 'keyword.control.export.ts'},
2: {name: 'keyword.control.type.ts'},
3: {name: 'keyword.operator.assignment.ts'},
4: {name: 'keyword.control.default.ts'}
},
end: '(?=$|;|^\\s*$|(?:^\\s*(?:abstract|async|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)\\b)|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)|var|while)\\b))',
name: 'meta.export.default.ts',
patterns: [
{include: '#interface-declaration'},
{include: '#expression'}
]
},
{
begin:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(export)(?:\\s+(type))?\\b(?!(\\$)|(\\s*:))((?=\\s*[\\{*])|((?=\\s*[_$[:alpha:]][_$[:alnum:]]*(\\s|,))(?!\\s*(?:abstract|async|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)\\b)|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)|var|while)\\b)))',
beginCaptures: {
1: {name: 'keyword.control.export.ts'},
2: {name: 'keyword.control.type.ts'}
},
end: '(?=$|;|^\\s*$|(?:^\\s*(?:abstract|async|(?:\\bawait\\s+(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)\\b)|break|case|catch|class|const|continue|declare|do|else|enum|export|finally|function|for|goto|if|import|interface|let|module|namespace|switch|return|throw|try|type|(?:\\busing(?=\\s+(?!in\\b|of\\b(?!\\s*(?:of\\b|=)))[_$[:alpha:]])\\b)|var|while)\\b))',
name: 'meta.export.ts',
patterns: [{include: '#import-export-declaration'}]
}
]
},
expression: {
patterns: [
{include: '#expressionWithoutIdentifiers'},
{include: '#identifiers'},
{include: '#expressionPunctuations'}
]
},
'expression-inside-possibly-arrow-parens': {
patterns: [
{include: '#expressionWithoutIdentifiers'},
{include: '#comment'},
{include: '#string'},
{include: '#decorator'},
{include: '#destructuring-parameter'},
{
captures: {1: {name: 'storage.modifier.ts'}},
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(override|public|protected|private|readonly)\\s+(?=(override|public|protected|private|readonly)\\s+)'
},
{
captures: {
1: {name: 'storage.modifier.ts'},
2: {name: 'keyword.operator.rest.ts'},
3: {name: 'entity.name.function.ts variable.language.this.ts'},
4: {name: 'entity.name.function.ts'},
5: {name: 'keyword.operator.optional.ts'}
},
match:
'(?x)(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(override|public|private|protected|readonly)\\s+)?(?:(\\.\\.\\.)\\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*(\\??)(?=\\s*\n# function assignment |\n(=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\\'\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\\'([^\\\'\\\\]|\\\\.)*\\\')|(\\"([^\\"\\\\]|\\\\.)*\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)) |\n# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>\n(:\\s*(\n (<) |\n ([(]\\s*(\n ([)]) |\n (\\.\\.\\.) |\n ([_$[:alnum:]]+\\s*(\n ([:,?=])|\n ([)]\\s*=>)\n ))\n ))\n)) |\n(:\\s*(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))Function(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))) |\n(:\\s*((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*))))))) |\n(:\\s*(=>|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(<[^<>]*>)|[^<>(),=])+=\\s*(\n ((async\\s+)?(\n (function\\s*[(<*]) |\n (function\\s+) |\n ([_$[:alpha:]][_$[:alnum:]]*\\s*=>)\n )) |\n ((async\\s*)?(\n ((<\\s*$)|((<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?[\\(]\\s*((([\\{\\[]\\s*)?$)|((\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})\\s*((:\\s*\\{?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))|((\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])\\s*((:\\s*\\[?$)|((\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+\\s*)?=\\s*)))))) |\n # sure shot arrow functions even if => is on new line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n [(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n (\n ([)]\\s*:) | # ():\n ((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:) # [(]param: | [(]...param:\n )\n) |\n\n# arrow function possible to detect only with => on same line\n(\n (<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)? # typeparameters\n \\(\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*(([_$[:alpha:]]|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\])|(\\.\\.\\.\\s*[_$[:alpha:]]))([^()\\\'\\"\\`]|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\\'([^\\\'\\\\]|\\\\.)*\\\')|(\\"([^\\"\\\\]|\\\\.)*\\")|(\\`([^\\`\\\\]|\\\\.)*\\`))*)?\\) # parameters\n (\\s*:\\s*([^<>\\(\\)\\{\\}]|\\<([^<>]|\\<([^<>]|\\<[^<>]+\\>)+\\>)+\\>|\\([^\\(\\)]+\\)|\\{[^\\{\\}]+\\})+)? # return type\n \\s*=> # arrow operator\n)\n ))\n)))'
},
{
captures: {
1: {name: 'storage.modifier.ts'},
2: {name: 'keyword.operator.rest.ts'},
3: {name: 'variable.parameter.ts variable.language.this.ts'},
4: {name: 'variable.parameter.ts'},
5: {name: 'keyword.operator.optional.ts'}
},
match:
'(?x)(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(override|public|private|protected|readonly)\\s+)?(?:(\\.\\.\\.)\\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))\\s*(\\??)(?=\\s*[:,]|$)'
},
{include: '#type-annotation'},
{include: '#variable-initializer'},
{match: ',', name: 'punctuation.separator.parameter.ts'},
{include: '#identifiers'},
{include: '#expressionPunctuations'}
]
},
'expression-operators': {
patterns: [
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(await)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'keyword.control.flow.ts'
},
{
begin:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(yield)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))(?=\\s*\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*\\*)',
beginCaptures: {1: {name: 'keyword.control.flow.ts'}},
end: '\\*',
endCaptures: {0: {name: 'keyword.generator.asterisk.ts'}},
patterns: [{include: '#comment'}]
},
{
captures: {
1: {name: 'keyword.control.flow.ts'},
2: {name: 'keyword.generator.asterisk.ts'}
},
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(yield)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))(?:\\s*(\\*))?'
},
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))delete(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'keyword.operator.expression.delete.ts'
},
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))in(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))(?!\\()',
name: 'keyword.operator.expression.in.ts'
},
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))of(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))(?!\\()',
name: 'keyword.operator.expression.of.ts'
},
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))instanceof(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'keyword.operator.expression.instanceof.ts'
},
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))new(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'keyword.operator.new.ts'
},
{include: '#typeof-operator'},
{
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))void(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))',
name: 'keyword.operator.expression.void.ts'
},
{
captures: {
1: {name: 'keyword.control.as.ts'},
2: {name: 'storage.modifier.ts'}
},
match:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as)\\s+(const)(?=\\s*($|[;,:})\\]]))'
},
{
begin:
'(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(as)|(satisfies))\\s+',
beginCaptures: {
1: {name: 'keyword.control.as.ts'},
2: {name: 'keyword.control.satisfies.ts'}
},
end: '(?=^|[;),}\\]:?\\-\\+\\>]|\\|\\||\\&\\&|\\!\\=\\=|$|((?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(as|satisfies)\\s+)|(\\s+\\<))',
patterns: [{include: '#type'}]
},
{match: '\\.\\.\\.', name: 'keyword.operator.spread.ts'},
{
match: '\\*=|(?<!\\()/=|%=|\\+=|\\-=',
name: 'keyword.operator.assignment.compound.ts'
},
{
match: '\\&=|\\^=|<<=|>>=|>>>=|\\|=',
name: 'keyword.operator.assignment.compound.bitwise.ts'
},
{match: '<<|>>>|>>', name: 'keyword.operator.bitwise.shift.ts'},
{match: '===|!==|==|!=', name: 'keyword.operator.comparison.ts'},
{match: '<=|>=|<>|<|>', name: 'keyword.operator.relational.ts'},
{
captures: {
1: {name: 'keyword.operator.logical.ts'},
2: {name: 'keyword.operator.assignment.compound.ts'},
3: {name: 'keyword.operator.arithmetic.ts'}
},
match: '(?<=[_$[:alnum:]])(\\!)\\s*(?:(/=)|(?:(/)(?![/*])))'
},
{match: '\\!|&&|\\|\\||\\?\\?', name: 'keyword.operator.logical.ts'},
{match: '\\&|~|\\^|\\|', name: 'keyword.operator.bitwise.ts'},