@@ -35,7 +35,7 @@ repository:
3535 beginCaptures :
3636 ' 1 ' : { name: keyword.control.export.ts }
3737 ' 2 ' : { name: storage.type.ts }
38- end : (?=$|;|}|(\s+(of|in)\s+))
38+ end : (?=$|^| ;|}|(\s+(of|in)\s+))
3939 patterns :
4040 - include : ' #destructuring-variable'
4141 - include : ' #var-single-variable'
@@ -76,21 +76,21 @@ repository:
7676 )
7777 beginCaptures :
7878 ' 1 ' : { name: meta.definition.variable.ts entity.name.function.ts }
79- end : (?=$|[;,=}]|(\s+(of|in)\s+))
79+ end : (?=$|^| [;,=}]|(\s+(of|in)\s+))
8080 patterns :
8181 - include : ' #var-single-variable-type-annotation'
8282 - name : meta.var-single-variable.expr.ts
8383 begin : ([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])
8484 beginCaptures :
8585 ' 1 ' : { name: meta.definition.variable.ts variable.other.constant.ts }
86- end : (?=$|[;,=}]|(\s+(of|in)\s+))
86+ end : (?=$|^| [;,=}]|(\s+(of|in)\s+))
8787 patterns :
8888 - include : ' #var-single-variable-type-annotation'
8989 - name : meta.var-single-variable.expr.ts
9090 begin : ([_$[:alpha:]][_$[:alnum:]]*)
9191 beginCaptures :
9292 ' 1 ' : { name: meta.definition.variable.ts variable.other.readwrite.ts }
93- end : (?=$|[;,=}]|(\s+(of|in)\s+))
93+ end : (?=$|^| [;,=}]|(\s+(of|in)\s+))
9494 patterns :
9595 - include : ' #var-single-variable-type-annotation'
9696
@@ -104,14 +104,14 @@ repository:
104104 patterns :
105105 - name : meta.object-binding-pattern-variable.ts
106106 begin : (?<!=|:|of|in)\s*(?=\{)
107- end : (?=$|[;,=}]|(\s+(of|in)\s+))
107+ end : (?=$|^| [;,=}]|(\s+(of|in)\s+))
108108 patterns :
109109 - include : ' #object-binding-pattern'
110110 - include : ' #type-annotation'
111111 - include : ' #comment'
112112 - name : meta.array-binding-pattern-variable.ts
113113 begin : (?<!=|:|of|in)\s*(?=\[)
114- end : (?=$|[;,=}]|(\s+(of|in)\s+))
114+ end : (?=$|^| [;,=}]|(\s+(of|in)\s+))
115115 patterns :
116116 - include : ' #array-binding-pattern'
117117 - include : ' #type-annotation'
@@ -541,11 +541,11 @@ repository:
541541 begin : (?<!\()(?:(?<!\.|\$)\b(readonly)\s+)?(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\'[^']*\')|(\"[^"]*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))
542542 beginCaptures :
543543 ' 1 ' : { name: storage.modifier.ts }
544- end : ' (?=\}|;|,|$)|(? <=\})'
544+ end : (?=\}|;|,|$|(^(?!(([_$[:alpha:]][_$[:alnum:]]* )|(\'[^']*\')|(\"[^"]*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))))|(? <=\})
545545 patterns :
546546 - include : ' #variable-initializer'
547547 - begin : (?=((?:[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))
548- end : (?=[};,=]|$)|(?<=\})
548+ end : (?=[};,=]|$|(^(?!(([_$[:alpha:]][_$[:alnum:]]*)|(\'[^']*\')|(\"[^"]*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))) )|(?<=\})
549549 patterns :
550550 - include : ' #type-annotation'
551551 - include : ' #string'
@@ -681,7 +681,7 @@ repository:
681681 ' 3 ' : { name: storage.type.function.ts }
682682 ' 4 ' : { name: keyword.generator.asterisk.ts }
683683 ' 5 ' : { name: meta.definition.function.ts entity.name.function.ts }
684- end : (?=$|;)|(?<=\})
684+ end : (?=$|^| ;)|(?<=\})
685685 patterns :
686686 - include : ' #comment'
687687 - include : ' #type-parameters'
@@ -860,7 +860,7 @@ repository:
860860 begin : (?<=\))\s*(:)
861861 beginCaptures :
862862 ' 1 ' : { name: keyword.operator.type.annotation.ts }
863- end : (?<![:|&])(( ?=$)|(?= [{};,]|//) )
863+ end : (?<![:|&])(?=$|^| [{};,]|//)
864864 patterns :
865865 - include : ' #comment'
866866 # Handle returning of object type specifically here so as to not confuse it with the start of function block
@@ -880,7 +880,7 @@ repository:
880880 begin : " :"
881881 beginCaptures :
882882 ' 0 ' : { name: keyword.operator.type.annotation.ts }
883- end : (?=$|[,);\}\]]|//)|(?==[^>])|(?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)
883+ end : (?=$|^| [,);\}\]]|//)|(?==[^>])|(?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)
884884 patterns :
885885 - include : ' #comment'
886886 - include : ' #type'
@@ -1055,7 +1055,7 @@ repository:
10551055 - begin : (?<!=|!)(=)(?!=)(?=\s*\S)
10561056 beginCaptures :
10571057 ' 1 ' : { name: keyword.operator.assignment.ts }
1058- end : (?=$|[,);}\]])
1058+ end : (?=$|^| [,);}\]])
10591059 patterns :
10601060 - include : ' #expression'
10611061 # if the expression doesnt start on same line do not use end of line as end of unless the complete line is blank
@@ -1611,7 +1611,7 @@ repository:
16111611 - begin : (?<!\.|\$)\b(as)\s+
16121612 beginCaptures :
16131613 ' 1 ' : { name: keyword.control.as.ts }
1614- end : (?=$|[;,:})\]])
1614+ end : (?=$|^| [;,:})\]])
16151615 patterns :
16161616 - include : ' #type'
16171617 - name : keyword.operator.spread.ts
@@ -1999,20 +1999,20 @@ repository:
19991999 - begin : (^[ \t]+)?(?=//)
20002000 beginCaptures :
20012001 ' 1 ' : { name: punctuation.whitespace.comment.leading.ts }
2002- end : (?=$ )
2002+ end : (?=^[^/][^/] )
20032003 patterns :
20042004 - name : comment.line.double-slash.ts
20052005 begin : //
20062006 beginCaptures :
20072007 ' 0 ' : { name: punctuation.definition.comment.ts }
2008- end : (?=$ )
2008+ end : (?=^ )
20092009
20102010 directives :
20112011 name : comment.line.triple-slash.directive.ts
20122012 begin : ^(///)\s*(?=<(reference|amd-dependency|amd-module)(\s+(path|types|no-default-lib|name)\s*=\s*((\'[^']*\')|(\"[^"]*\")))+\s*/>\s*$)
20132013 beginCaptures :
20142014 ' 1 ' : { name: punctuation.definition.comment.ts }
2015- end : (?=$ )
2015+ end : (?=^ )
20162016 patterns :
20172017 - name : meta.tag.ts
20182018 begin : (<)(reference|amd-dependency|amd-module)
0 commit comments