@@ -36,7 +36,7 @@ variables:
36
36
typeParamersStart : ([_$[:alpha:]]|{{matchingBraces}}|{{matchingParenthesis}}|{{matchingBrackets}})
37
37
typeParameters : (<\s*{{typeParamersStart}}([^=<>]|=[^<]|\<\s*{{typeParamersStart}}([^=<>]|=[^<])*\>)*>\s*)
38
38
# Identifier start | matching braces | matching parenthesis | matching square brackets | matching strings
39
- typeArgumentsStart : ({{identifier}}|{{matchingBraces}}|{{matchingParenthesis}}|{{matchingBrackets}}|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,]|=>|&(?!&)|\|(?!\|)))
39
+ typeArgumentsStart : ({{identifier}}|{{matchingBraces}}|{{matchingParenthesis}}|{{matchingBrackets}}|(\'[^\']*\')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[ ]|=>|&(?!&)|\|(?!\|)))
40
40
typeArgumentsInnerExpressionPart : ' [^<>\(]|{{matchingParenthesis}}|(?<==)\>'
41
41
typeArguments : ' <\s*{{typeArgumentsStart}}({{typeArgumentsInnerExpressionPart}}|\<\s*{{typeArgumentsStart}}({{typeArgumentsInnerExpressionPart}})*(?!=)\>)*(?!=)>'
42
42
functionCallLookup : \s*(\?\.\s*)?({{typeArguments}}\s*)?\(
@@ -619,16 +619,18 @@ repository:
619
619
620
620
indexer-mapped-type-declaration :
621
621
name : meta.indexer.mappedtype.declaration.ts
622
- begin : (?:{{startOfIdentifier}}(readonly)\s*)?(\[)\s*({{identifier}})\s+(in)\s+
622
+ begin : (?:{{startOfIdentifier}}([+-])?( readonly)\s*)?(\[)\s*({{identifier}})\s+(in)\s+
623
623
beginCaptures :
624
- ' 1 ' : { name: storage.modifier.ts }
625
- ' 2 ' : { name: meta.brace.square.ts }
626
- ' 3 ' : { name: entity.name.type.ts }
627
- ' 4 ' : { name: keyword.operator.expression.in.ts }
628
- end : (\])\s*(\?\s*)?|$
624
+ ' 1 ' : { name: keyword.operator.type.modifier.ts }
625
+ ' 2 ' : { name: storage.modifier.ts }
626
+ ' 3 ' : { name: meta.brace.square.ts }
627
+ ' 4 ' : { name: entity.name.type.ts }
628
+ ' 5 ' : { name: keyword.operator.expression.in.ts }
629
+ end : (\])([+-])?\s*(\?\s*)?|$
629
630
endCaptures :
630
631
' 1 ' : { name: meta.brace.square.ts }
631
- ' 2 ' : { name: keyword.operator.optional.ts }
632
+ ' 2 ' : { name: keyword.operator.type.modifier.ts }
633
+ ' 3 ' : { name: keyword.operator.optional.ts }
632
634
patterns :
633
635
- include : ' #type'
634
636
@@ -1140,7 +1142,7 @@ repository:
1140
1142
begin : ' {{startOfIdentifier}}(new){{endOfIdentifier}}'
1141
1143
beginCaptures :
1142
1144
' 1 ' : { name: keyword.operator.new.ts }
1143
- end : (?<=\))|(?=[;),}\]:]|$|({{startOfIdentifier}}new{{endOfIdentifier}})|({{startOfIdentifier}}function((\s+{{identifier}})|(\s*[\(]))))
1145
+ end : (?<=\))|(?=[;),}\]:]|\|\||\&\&| $|({{startOfIdentifier}}new{{endOfIdentifier}})|({{startOfIdentifier}}function((\s+{{identifier}})|(\s*[\(]))))
1144
1146
patterns :
1145
1147
- include : ' #paren-expression'
1146
1148
- include : ' #class-declaration'
@@ -1150,7 +1152,7 @@ repository:
1150
1152
begin : ' {{startOfIdentifier}}(instanceof){{endOfIdentifier}}'
1151
1153
beginCaptures :
1152
1154
' 1 ' : { name: keyword.operator.expression.instanceof.ts }
1153
- end : (?<=\))|(?=[;),}\]:]|$|({{startOfIdentifier}}function((\s+{{identifier}})|(\s*[\(]))))
1155
+ end : (?<=\))|(?=[;),}\]:]|\|\||\&\&| $|({{startOfIdentifier}}function((\s+{{identifier}})|(\s*[\(]))))
1154
1156
patterns :
1155
1157
- include : ' #type'
1156
1158
0 commit comments