@@ -31,7 +31,7 @@ repository:
31
31
32
32
var-expr :
33
33
name : meta.var.expr.ts
34
- begin : (?<!\.|\$)(?:(\bexport)\s+)?\b(var|let|const(?!\s+enum\b))\b(?!\$)
34
+ begin : (?<!\.|\$)(?:(\bexport)\s+)?\b(var|let|const(?!\s+enum\b))\b(?!\$|\. )
35
35
beginCaptures :
36
36
' 1 ' : { name: keyword.control.export.ts }
37
37
' 2 ' : { name: storage.type.ts }
@@ -211,21 +211,21 @@ repository:
211
211
# TODO: convert this to actual statements instead
212
212
patterns :
213
213
- name : keyword.control.trycatch.ts
214
- match : (?<!\.|\$)\b(catch|finally|throw|try)\b(?!\$)
214
+ match : (?<!\.|\$)\b(catch|finally|throw|try)\b(?!\$|\. )
215
215
- name : keyword.control.loop.ts
216
- match : (?<!\.|\$)\b(break|continue|do|goto|while)\b(?!\$)
216
+ match : (?<!\.|\$)\b(break|continue|do|goto|while)\b(?!\$|\. )
217
217
- name : keyword.control.flow.ts
218
- match : (?<!\.|\$)\b(return)\b(?!\$)
218
+ match : (?<!\.|\$)\b(return)\b(?!\$|\. )
219
219
- name : keyword.control.switch.ts
220
- match : (?<!\.|\$)\b(case|default|switch)\b(?!\$)
220
+ match : (?<!\.|\$)\b(case|default|switch)\b(?!\$|\. )
221
221
- name : keyword.control.conditional.ts
222
- match : (?<!\.|\$)\b(else|if)\b(?!\$)
222
+ match : (?<!\.|\$)\b(else|if)\b(?!\$|\. )
223
223
- name : keyword.control.with.ts
224
- match : (?<!\.|\$)\b(with)\b(?!\$)
224
+ match : (?<!\.|\$)\b(with)\b(?!\$|\. )
225
225
- name : keyword.other.debugger.ts
226
- match : (?<!\.|\$)\b(debugger)\b(?!\$)
226
+ match : (?<!\.|\$)\b(debugger)\b(?!\$|\. )
227
227
- name : storage.modifier.ts
228
- match : (?<!\.|\$)\b(declare)\b(?!\$)
228
+ match : (?<!\.|\$)\b(declare)\b(?!\$|\. )
229
229
230
230
declaration :
231
231
patterns :
@@ -350,7 +350,7 @@ repository:
350
350
351
351
import-declaration :
352
352
name : meta.import.ts
353
- begin : (?<!\.|\$)(?:(\bexport)\s+)?\b(import)(?!(\s*:)|(\$))\b
353
+ begin : (?<!\.|\$)(?:(\bexport)\s+)?\b(import)(?!(\s*:)|(\$|\. ))\b
354
354
beginCaptures :
355
355
' 1 ' : { name: keyword.control.export.ts }
356
356
' 2 ' : { name: keyword.control.import.ts }
@@ -446,7 +446,7 @@ repository:
446
446
- include : ' #class-or-interface-body'
447
447
448
448
class-or-interface-heritage :
449
- begin : (?<!\.|\$)(?:\b(extends|implements)\b)(?!\$)
449
+ begin : (?<!\.|\$)(?:\b(extends|implements)\b)(?!\$|\. )
450
450
beginCaptures :
451
451
' 1 ' : { name: storage.modifier.ts }
452
452
end : (?=\{)
@@ -566,7 +566,7 @@ repository:
566
566
567
567
method-declaration :
568
568
name : meta.method.declaration.ts
569
- begin : (?<!\.|\$)(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(?:\b(?:(new)|(constructor))\b(?!\$|:))|(?:(\*)\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\'[^']*\')|(\"[^"]*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))?\s*[\(\<]))
569
+ begin : (?<!\.|\$)(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(?:\b(?:(new)|(constructor))\b(?!\$|\.| :))|(?:(\*)\s*)?(?=((([_$[:alpha:]][_$[:alnum:]]*)|(\'[^']*\')|(\"[^"]*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))?\s*[\(\<]))
570
570
beginCaptures :
571
571
' 1 ' : { name: storage.modifier.ts } # captures keyword (public or private or protected)
572
572
' 2 ' : { name: storage.modifier.ts } # captures keyword (abstract)
@@ -854,7 +854,7 @@ repository:
854
854
855
855
type-predicate-operator :
856
856
name : keyword.operator.expression.is.ts
857
- match : (?<!\.|\$)\bis\b(?!\$)
857
+ match : (?<!\.|\$)\bis\b(?!\$|\. )
858
858
859
859
type-annotation :
860
860
name : meta.type.annotation.ts
@@ -902,11 +902,11 @@ repository:
902
902
903
903
type-primitive :
904
904
name : support.type.primitive.ts
905
- match : (?<!\.|\$)\b(string|number|boolean|symbol|any|void|never)\b(?!\$)
905
+ match : (?<!\.|\$)\b(string|number|boolean|symbol|any|void|never)\b(?!\$|\. )
906
906
907
907
type-builtin-literals :
908
908
name : support.type.builtin.ts
909
- match : (?<!\.|\$)\b(this|true|false|undefined|null|object)\b(?!\$)
909
+ match : (?<!\.|\$)\b(this|true|false|undefined|null|object)\b(?!\$|\. )
910
910
911
911
# Parenthesis can contain either types and function parameters
912
912
# (number | string) or (param: number, param2: string)
@@ -963,7 +963,7 @@ repository:
963
963
- name : keyword.operator.type.ts
964
964
match : ' [&|]'
965
965
- name : keyword.operator.expression.keyof.ts
966
- match : (?<!\.|\$)\bkeyof\b(?!\$)
966
+ match : (?<!\.|\$)\bkeyof\b(?!\$|\. )
967
967
968
968
type-function-return-type :
969
969
name : meta.type.function.return.ts
@@ -1079,7 +1079,7 @@ repository:
1079
1079
1080
1080
case-clause :
1081
1081
name : case-clause.expr.ts
1082
- begin : (?<!\.|\$)\b(case|default(?=:))\b(?!\$)
1082
+ begin : (?<!\.|\$)\b(case|default(?=:))\b(?!\$|\. )
1083
1083
beginCaptures :
1084
1084
' 1 ' : { name: keyword.control.switch.ts }
1085
1085
end : ' :'
@@ -1474,10 +1474,10 @@ repository:
1474
1474
1475
1475
new-expr :
1476
1476
name : new.expr.ts
1477
- begin : (?<!\.|\$)\b(new)\b(?!\$)
1477
+ begin : (?<!\.|\$)\b(new)\b(?!\$|\. )
1478
1478
beginCaptures :
1479
1479
' 1 ' : { name: keyword.operator.new.ts }
1480
- end : (?<=\))|(?=[;),}]|$|((?<!\.|\$)\bnew\b(?!\$)))
1480
+ end : (?<=\))|(?=[;),}]|$|((?<!\.|\$)\bnew\b(?!\$|\. )))
1481
1481
patterns :
1482
1482
- include : ' #paren-expression'
1483
1483
- include : ' #class-or-interface-declaration'
@@ -1539,27 +1539,28 @@ repository:
1539
1539
expression-operators :
1540
1540
patterns :
1541
1541
- name : keyword.control.flow.ts
1542
- match : (?<!\.|\$)\b(await)\b(?!\$)
1543
- - match : (?<!\.|\$)\b(yield)\b(?!\$)(?:\s*(\*))?
1542
+ match : (?<!\.|\$)\b(await)\b(?!\$|\. )
1543
+ - match : (?<!\.|\$)\b(yield)\b(?!\$|\. )(?:\s*(\*))?
1544
1544
captures :
1545
1545
' 1 ' : { name: keyword.control.flow.ts }
1546
1546
' 2 ' : { name: keyword.generator.asterisk.ts }
1547
1547
- name : keyword.operator.expression.delete.ts
1548
- match : (?<!\.|\$)\bdelete\b(?!\$)
1548
+ match : (?<!\.|\$)\bdelete\b(?!\$|\. )
1549
1549
- name : keyword.operator.expression.in.ts
1550
- match : (?<!\.|\$)\bin\b(?!\$)
1550
+ match : (?<!\.|\$)\bin\b(?!\$|\. )
1551
1551
- name : keyword.operator.expression.of.ts
1552
- match : (?<!\.|\$)\bof\b(?!\$)
1552
+ match : (?<!\.|\$)\bof\b(?!\$|\. )
1553
1553
- name : keyword.operator.expression.instanceof.ts
1554
- match : (?<!\.|\$)\binstanceof\b(?!\$)
1554
+ match : (?<!\.|\$)\binstanceof\b(?!\$|\. )
1555
1555
- name : keyword.operator.new.ts
1556
- match : (?<!\.|\$)\bnew\b(?!\$)
1556
+ match : (?<!\.|\$)\bnew\b(?!\$|\. )
1557
1557
- include : ' #typeof-operator'
1558
1558
- name : keyword.operator.expression.void.ts
1559
- match : (?<!\.|\$)\bvoid\b(?!\$)
1560
- - begin : (?<!\.|\$)\bas\b(?!\$)
1559
+ match : (?<!\.|\$)\bvoid\b(?!\$|\.)
1560
+ # handle as operator specifically to be recognized only if it is 'as' followed by space
1561
+ - begin : (?<!\.|\$)\b(as)\s+
1561
1562
beginCaptures :
1562
- ' 0 ' : { name: keyword.control.as.ts }
1563
+ ' 1 ' : { name: keyword.control.as.ts }
1563
1564
end : (?=$|[;,:})\]])
1564
1565
patterns :
1565
1566
- include : ' #type'
@@ -1594,7 +1595,7 @@ repository:
1594
1595
1595
1596
typeof-operator :
1596
1597
name : keyword.operator.expression.typeof.ts
1597
- match : (?<!\.|\$)\btypeof\b(?!\$)
1598
+ match : (?<!\.|\$)\btypeof\b(?!\$|\. )
1598
1599
1599
1600
arrow-function :
1600
1601
patterns :
@@ -1927,11 +1928,11 @@ repository:
1927
1928
1928
1929
access-modifier :
1929
1930
name : storage.modifier.ts
1930
- match : (?<!\.|\$)\b(abstract|public|protected|private|readonly|static)\b(?!\$)
1931
+ match : (?<!\.|\$)\b(abstract|public|protected|private|readonly|static)\b(?!\$|\. )
1931
1932
1932
1933
property-accessor :
1933
1934
name : storage.type.property.ts
1934
- match : (?<!\.|\$)\b(get|set)\b(?!\$)
1935
+ match : (?<!\.|\$)\b(get|set)\b(?!\$|\. )
1935
1936
1936
1937
comment :
1937
1938
patterns :
0 commit comments