@@ -35,7 +35,7 @@ repository:
35
35
beginCaptures :
36
36
' 1 ' : { name: keyword.control.export.ts }
37
37
' 2 ' : { name: storage.type.ts }
38
- end : (?=$|;|}|(\s+(of|in)\s+))
38
+ end : (?=$|^| ;|}|(\s+(of|in)\s+))
39
39
patterns :
40
40
- include : ' #destructuring-variable'
41
41
- include : ' #var-single-variable'
@@ -76,21 +76,21 @@ repository:
76
76
)
77
77
beginCaptures :
78
78
' 1 ' : { name: meta.definition.variable.ts entity.name.function.ts }
79
- end : (?=$|[;,=}]|(\s+(of|in)\s+))
79
+ end : (?=$|^| [;,=}]|(\s+(of|in)\s+))
80
80
patterns :
81
81
- include : ' #var-single-variable-type-annotation'
82
82
- name : meta.var-single-variable.expr.ts
83
83
begin : ([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])
84
84
beginCaptures :
85
85
' 1 ' : { name: meta.definition.variable.ts variable.other.constant.ts }
86
- end : (?=$|[;,=}]|(\s+(of|in)\s+))
86
+ end : (?=$|^| [;,=}]|(\s+(of|in)\s+))
87
87
patterns :
88
88
- include : ' #var-single-variable-type-annotation'
89
89
- name : meta.var-single-variable.expr.ts
90
90
begin : ([_$[:alpha:]][_$[:alnum:]]*)
91
91
beginCaptures :
92
92
' 1 ' : { name: meta.definition.variable.ts variable.other.readwrite.ts }
93
- end : (?=$|[;,=}]|(\s+(of|in)\s+))
93
+ end : (?=$|^| [;,=}]|(\s+(of|in)\s+))
94
94
patterns :
95
95
- include : ' #var-single-variable-type-annotation'
96
96
@@ -104,14 +104,14 @@ repository:
104
104
patterns :
105
105
- name : meta.object-binding-pattern-variable.ts
106
106
begin : (?<!=|:|of|in)\s*(?=\{)
107
- end : (?=$|[;,=}]|(\s+(of|in)\s+))
107
+ end : (?=$|^| [;,=}]|(\s+(of|in)\s+))
108
108
patterns :
109
109
- include : ' #object-binding-pattern'
110
110
- include : ' #type-annotation'
111
111
- include : ' #comment'
112
112
- name : meta.array-binding-pattern-variable.ts
113
113
begin : (?<!=|:|of|in)\s*(?=\[)
114
- end : (?=$|[;,=}]|(\s+(of|in)\s+))
114
+ end : (?=$|^| [;,=}]|(\s+(of|in)\s+))
115
115
patterns :
116
116
- include : ' #array-binding-pattern'
117
117
- include : ' #type-annotation'
@@ -541,11 +541,11 @@ repository:
541
541
begin : (?<!\()(?:(?<!\.|\$)\b(readonly)\s+)?(?=(([_$[:alpha:]][_$[:alnum:]]*)|(\'[^']*\')|(\"[^"]*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))
542
542
beginCaptures :
543
543
' 1 ' : { name: storage.modifier.ts }
544
- end : ' (?=\}|;|,|$)|(? <=\})'
544
+ end : (?=\}|;|,|$|(^(?!(([_$[:alpha:]][_$[:alnum:]]* )|(\'[^']*\')|(\"[^"]*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))))|(? <=\})
545
545
patterns :
546
546
- include : ' #variable-initializer'
547
547
- begin : (?=((?:[_$[:alpha:]][_$[:alnum:]]*)|(?:\'[^']*\')|(?:\"[^"]*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))
548
- end : (?=[};,=]|$)|(?<=\})
548
+ end : (?=[};,=]|$|(^(?!(([_$[:alpha:]][_$[:alnum:]]*)|(\'[^']*\')|(\"[^"]*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))) )|(?<=\})
549
549
patterns :
550
550
- include : ' #type-annotation'
551
551
- include : ' #string'
@@ -681,7 +681,7 @@ repository:
681
681
' 3 ' : { name: storage.type.function.ts }
682
682
' 4 ' : { name: keyword.generator.asterisk.ts }
683
683
' 5 ' : { name: meta.definition.function.ts entity.name.function.ts }
684
- end : (?=$|;)|(?<=\})
684
+ end : (?=$|^| ;)|(?<=\})
685
685
patterns :
686
686
- include : ' #comment'
687
687
- include : ' #type-parameters'
@@ -860,7 +860,7 @@ repository:
860
860
begin : (?<=\))\s*(:)
861
861
beginCaptures :
862
862
' 1 ' : { name: keyword.operator.type.annotation.ts }
863
- end : (?<![:|&])(( ?=$)|(?= [{};,]|//) )
863
+ end : (?<![:|&])(?=$|^| [{};,]|//)
864
864
patterns :
865
865
- include : ' #comment'
866
866
# Handle returning of object type specifically here so as to not confuse it with the start of function block
@@ -880,7 +880,7 @@ repository:
880
880
begin : " :"
881
881
beginCaptures :
882
882
' 0 ' : { name: keyword.operator.type.annotation.ts }
883
- end : (?=$|[,);\}\]]|//)|(?==[^>])|(?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)
883
+ end : (?=$|^| [,);\}\]]|//)|(?==[^>])|(?<=[\}>\]\)]|[_$[:alpha:]])\s*(?=\{)
884
884
patterns :
885
885
- include : ' #comment'
886
886
- include : ' #type'
@@ -1055,7 +1055,7 @@ repository:
1055
1055
- begin : (?<!=|!)(=)(?!=)(?=\s*\S)
1056
1056
beginCaptures :
1057
1057
' 1 ' : { name: keyword.operator.assignment.ts }
1058
- end : (?=$|[,);}\]])
1058
+ end : (?=$|^| [,);}\]])
1059
1059
patterns :
1060
1060
- include : ' #expression'
1061
1061
# 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:
1611
1611
- begin : (?<!\.|\$)\b(as)\s+
1612
1612
beginCaptures :
1613
1613
' 1 ' : { name: keyword.control.as.ts }
1614
- end : (?=$|[;,:})\]])
1614
+ end : (?=$|^| [;,:})\]])
1615
1615
patterns :
1616
1616
- include : ' #type'
1617
1617
- name : keyword.operator.spread.ts
@@ -1999,20 +1999,20 @@ repository:
1999
1999
- begin : (^[ \t]+)?(?=//)
2000
2000
beginCaptures :
2001
2001
' 1 ' : { name: punctuation.whitespace.comment.leading.ts }
2002
- end : (?=$ )
2002
+ end : (?=^[^/][^/] )
2003
2003
patterns :
2004
2004
- name : comment.line.double-slash.ts
2005
2005
begin : //
2006
2006
beginCaptures :
2007
2007
' 0 ' : { name: punctuation.definition.comment.ts }
2008
- end : (?=$ )
2008
+ end : (?=^ )
2009
2009
2010
2010
directives :
2011
2011
name : comment.line.triple-slash.directive.ts
2012
2012
begin : ^(///)\s*(?=<(reference|amd-dependency|amd-module)(\s+(path|types|no-default-lib|name)\s*=\s*((\'[^']*\')|(\"[^"]*\")))+\s*/>\s*$)
2013
2013
beginCaptures :
2014
2014
' 1 ' : { name: punctuation.definition.comment.ts }
2015
- end : (?=$ )
2015
+ end : (?=^ )
2016
2016
patterns :
2017
2017
- name : meta.tag.ts
2018
2018
begin : (<)(reference|amd-dependency|amd-module)
0 commit comments