@@ -33,13 +33,16 @@ variables:
3333 # any use of property name needs to ignore line breaks in regular expression because of decimal number regex (maintained for readability)
3434 propertyName : ({{anyNumber}}|({{identifier}})|{{nonIdentifierPropertyName}})
3535 constantVar : ({{constantIdentifier}})(?![_$[:alnum:]])
36- endOfStatement : ' ;|\babstract \b|\basync \b|\bclass \b|\bconst \b|\bdeclare \b|\benum \b|\bexport \b|\bfunction \b|\bimport \b|\binterface \b|\blet \b|\bmodule \b|\bnamespace \b|\breturn \b|\btype \b|\bvar \b'
36+ endOfStatement : ' ;|^\s*abstract \b|^\s*async \b|^\s*class \b|^\s*const \b|^\s*declare \b|^\s*enum \b|^\s*export \b|^\s*function \b|^\s*import \b|^\s*interface \b|^\s*let \b|^\s*module \b|^\s*namespace \b|^\s*return \b|^\s*type \b|^\s*var \b'
3737 nonPropertyLookBehind : ' [^\._$[:alnum:]]'
3838 lookBehindReturn : ' ^return|{{nonPropertyLookBehind}}return'
3939 lookBehindThrow : ' ^throw|{{nonPropertyLookBehind}}throw'
4040 lookBehindYield : ' ^yield|{{nonPropertyLookBehind}}yield'
4141 lookBehindAwait : ' ^await|{{nonPropertyLookBehind}}await'
4242 lookBehindDefault : ' ^default|{{nonPropertyLookBehind}}default'
43+ lookBehindConst : ' ^const|{{nonPropertyLookBehind}}const'
44+ lookBehindLet : ' ^let|{{nonPropertyLookBehind}}let'
45+ lookBehindVar : ' ^var|{{nonPropertyLookBehind}}var'
4346 lookBehindIn : ' ^in|{{nonPropertyLookBehind}}in'
4447 lookBehindOf : ' ^of|{{nonPropertyLookBehind}}of'
4548 lookBehindTypeof : ' ^typeof|{{nonPropertyLookBehind}}typeof'
@@ -243,7 +246,7 @@ repository:
243246 beginCaptures :
244247 ' 1 ' : { name: keyword.control.export.ts }
245248 ' 2 ' : { name: storage.type.ts }
246- end : (?=$|^| ;|}|(\s+(of|in)\s+))
249+ end : ((?= ;|}|(\s+(of|in)\s+)|^\s*$|{{endOfStatement}})|((?<=\S)(?<!{{lookBehindConst}}|{{lookBehindLet}}|{{lookBehindVar}})(?=\s*$) ))
247250 patterns :
248251 - include : ' #destructuring-variable'
249252 - include : ' #var-single-variable'
0 commit comments