@@ -106,33 +106,40 @@ repository:
106
106
- include : ' #array-binding-pattern'
107
107
- name : variable.other.readwrite.ts
108
108
match : ([_$[:alpha:]][_$[:alnum:]]*)
109
- - name : variable.other.readwrite.ts
110
- match : ([_$[:alpha:]][_$[:alnum:]]*)
109
+ - include : ' #object-binding-pattern '
110
+ - include : ' #destructuring-variable-rest '
111
111
- include : ' #punctuation-comma'
112
112
113
113
array-binding-element :
114
114
patterns :
115
115
- include : ' #comment'
116
116
- include : ' #object-binding-pattern'
117
117
- include : ' #array-binding-pattern'
118
- - name : variable.other.readwrite.ts
119
- match : ([_$[:alpha:]][_$[:alnum:]]*)
118
+ - include : ' #destructuring-variable-rest'
120
119
- include : ' #punctuation-comma'
121
120
121
+ destructuring-variable-rest :
122
+ match : (?:(\.\.\.)\s*)?([_$[:alpha:]][_$[:alnum:]]*)
123
+ captures :
124
+ ' 1 ' : { name: keyword.operator.rest.ts }
125
+ ' 2 ' : { name: variable.other.readwrite.ts }
126
+
122
127
object-binding-pattern :
123
- begin : \{
128
+ begin : (?:(\.\.\.)\s*)?(\{)
124
129
beginCaptures :
125
- ' 0 ' : { name: punctuation.definition.binding-pattern.object.ts }
130
+ ' 1 ' : { name: keyword.operator.rest.ts }
131
+ ' 2 ' : { name: punctuation.definition.binding-pattern.object.ts }
126
132
end : \}
127
133
endCaptures :
128
134
' 0 ' : { name: punctuation.definition.binding-pattern.object.ts }
129
135
patterns :
130
136
- include : ' #object-binding-element'
131
137
132
138
array-binding-pattern :
133
- begin : \[
139
+ begin : (?:(\.\.\.)\s*)?(\[)
134
140
beginCaptures :
135
- ' 0 ' : { name: punctuation.definition.binding-pattern.array.ts }
141
+ ' 1 ' : { name: keyword.operator.rest.ts }
142
+ ' 2 ' : { name: punctuation.definition.binding-pattern.array.ts }
136
143
end : \]
137
144
endCaptures :
138
145
' 0 ' : { name: punctuation.definition.binding-pattern.array.ts }
@@ -171,8 +178,7 @@ repository:
171
178
- include : ' #ternary-expression'
172
179
- include : ' #new-expr'
173
180
- include : ' #object-literal'
174
- - include : ' #expression-operator'
175
- - include : ' #operators'
181
+ - include : ' #expression-operators'
176
182
- include : ' #support-objects'
177
183
- include : ' #function-call'
178
184
- include : ' #identifiers'
@@ -457,6 +463,12 @@ repository:
457
463
- include : ' #method-declaration'
458
464
- include : ' #indexer-declaration'
459
465
- include : ' #type-annotation'
466
+ - begin : \.\.\.
467
+ beginCaptures :
468
+ ' 0 ' : { name: keyword.operator.spread.ts }
469
+ end : ' (?=\}|;|,|$)|(?<=\})'
470
+ patterns :
471
+ - include : ' #type'
460
472
- include : ' #punctuation-comma'
461
473
- include : ' #punctuation-semicolon'
462
474
@@ -609,7 +621,7 @@ repository:
609
621
match : ' (?:\s*\b(public|private|protected)\b\s+)?(\.\.\.)?\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\s*(\??)'
610
622
captures :
611
623
' 1 ' : { name: storage.modifier.ts }
612
- ' 2 ' : { name: keyword.operator.spread .ts }
624
+ ' 2 ' : { name: keyword.operator.rest .ts }
613
625
' 3 ' : { name: variable.parameter.ts }
614
626
' 4 ' : { name: keyword.operator.optional.ts }
615
627
@@ -647,33 +659,40 @@ repository:
647
659
- include : ' #parameter-array-binding-pattern'
648
660
- name : variable.parameter.ts
649
661
match : ([_$[:alpha:]][_$[:alnum:]]*)
650
- - name : variable. parameter.ts
651
- match : ([_$[:alpha:]][_$[:alnum:]]*)
662
+ - include : ' # parameter-object-binding-pattern '
663
+ - include : ' #destructuring-parameter-rest '
652
664
- include : ' #punctuation-comma'
653
665
654
666
parameter-array-binding-element :
655
667
patterns :
656
668
- include : ' #comment'
657
669
- include : ' #parameter-object-binding-pattern'
658
670
- include : ' #parameter-array-binding-pattern'
659
- - name : variable.parameter.ts
660
- match : ([_$[:alpha:]][_$[:alnum:]]*)
671
+ - include : ' #destructuring-parameter-rest'
661
672
- include : ' #punctuation-comma'
662
673
674
+ destructuring-parameter-rest :
675
+ match : (?:(\.\.\.)\s*)?([_$[:alpha:]][_$[:alnum:]]*)
676
+ captures :
677
+ ' 1 ' : { name: keyword.operator.rest.ts }
678
+ ' 2 ' : { name: variable.parameter.ts }
679
+
663
680
parameter-object-binding-pattern :
664
- begin : \{
681
+ begin : (?:(\.\.\.)\s*)?(\{)
665
682
beginCaptures :
666
- ' 0 ' : { name: punctuation.definition.binding-pattern.object.ts }
683
+ ' 1 ' : { name: keyword.operator.rest.ts }
684
+ ' 2 ' : { name: punctuation.definition.binding-pattern.object.ts }
667
685
end : \}
668
686
endCaptures :
669
687
' 0 ' : { name: punctuation.definition.binding-pattern.object.ts }
670
688
patterns :
671
689
- include : ' #parameter-object-binding-element'
672
690
673
691
parameter-array-binding-pattern :
674
- begin : \[
692
+ begin : (?:(\.\.\.)\s*)?(\[)
675
693
beginCaptures :
676
- ' 0 ' : { name: punctuation.definition.binding-pattern.array.ts }
694
+ ' 1 ' : { name: keyword.operator.rest.ts }
695
+ ' 2 ' : { name: punctuation.definition.binding-pattern.array.ts }
677
696
end : \]
678
697
endCaptures :
679
698
' 0 ' : { name: punctuation.definition.binding-pattern.array.ts }
@@ -723,11 +742,10 @@ repository:
723
742
- include : ' #numeric-literal'
724
743
- include : ' #type-primitive'
725
744
- include : ' #type-builtin-literals'
726
- - include : ' #typeof-operator'
727
745
- include : ' #type-parameters'
728
746
- include : ' #type-tuple'
729
747
- include : ' #type-object'
730
- - include : ' #type-operator '
748
+ - include : ' #type-operators '
731
749
- include : ' #type-fn-type-parameters'
732
750
- include : ' #type-paren-or-function-parameters'
733
751
- include : ' #type-function-return-type'
@@ -814,9 +832,11 @@ repository:
814
832
patterns :
815
833
- include : ' #function-parameters'
816
834
817
- type-operator :
818
- name : keyword.operator.type.ts
819
- match : ' [&|]'
835
+ type-operators :
836
+ patterns :
837
+ - include : ' #typeof-operator'
838
+ - name : keyword.operator.type.ts
839
+ match : ' [&|]'
820
840
821
841
type-function-return-type :
822
842
name : meta.type.function.return.ts
@@ -1335,13 +1355,20 @@ repository:
1335
1355
end : (?=,|\})
1336
1356
patterns :
1337
1357
- include : ' #expression'
1358
+ - name : meta.object.member.ts
1359
+ begin : \.\.\.
1360
+ beginCaptures :
1361
+ ' 0 ' : { name: keyword.operator.spread.ts }
1362
+ end : (?=,|\})
1363
+ patterns :
1364
+ - include : ' #expression'
1338
1365
- name : meta.object.member.ts
1339
1366
match : ([_$[:alpha:]][_$[:alnum:]]*)\s*(?=,|\})
1340
1367
captures :
1341
1368
' 1 ' : { name: variable.other.readwrite.ts }
1342
1369
- include : ' #punctuation-comma'
1343
1370
1344
- expression-operator :
1371
+ expression-operators :
1345
1372
patterns :
1346
1373
- name : keyword.control.flow.ts
1347
1374
match : (?<!\.|\$)\b(await)\b(?!\$)
@@ -1364,13 +1391,8 @@ repository:
1364
1391
end : (?=$|[;,})\]])
1365
1392
patterns :
1366
1393
- include : ' #type'
1367
-
1368
- typeof-operator :
1369
- name : keyword.operator.typeof.ts
1370
- match : (?<!\.|\$)\btypeof\b(?!\$)
1371
-
1372
- operators :
1373
- patterns :
1394
+ - name : keyword.operator.spread.ts
1395
+ match : \.\.\.
1374
1396
- name : keyword.operator.assignment.compound.ts
1375
1397
match : \*=|(?<!\()/=|%=|\+=|\-=
1376
1398
- name : keyword.operator.assignment.compound.bitwise.ts
@@ -1392,6 +1414,10 @@ repository:
1392
1414
- name : keyword.operator.arithmetic.ts
1393
1415
match : ' %|\*|/|-|\+'
1394
1416
1417
+ typeof-operator :
1418
+ name : keyword.operator.typeof.ts
1419
+ match : (?<!\.|\$)\btypeof\b(?!\$)
1420
+
1395
1421
arrow-function :
1396
1422
patterns :
1397
1423
- name : meta.arrow.ts
0 commit comments