@@ -49,25 +49,27 @@ repository:
49
49
- name : meta.var-single-variable.expr.ts
50
50
# function assignment |
51
51
# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
52
- begin : (?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\s*
53
- (=\s*(
54
- (async\s+) |
55
- (function\s*[(<]) |
56
- (function\s+) |
57
- ([_$[:alpha:]][_$[:alnum:]]*\s*=>) |
58
- ((<([^<>]|\<[^<>]+\>)+>\s*)?\(([^()]|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=>))
59
- ) |
60
- (:\s*(
61
- (<) |
62
- ([(]\s*(
63
- ([)]) |
64
- (\.\.\.) |
65
- ([_$[:alnum:]]+\s*(
66
- ([:,?=])|
67
- ([)]\s*=>)
68
- ))
69
- )))
70
- ))
52
+ begin : |-
53
+ (?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\s*
54
+ (=\s*(
55
+ (async\s+) |
56
+ (function\s*[(<]) |
57
+ (function\s+) |
58
+ ([_$[:alpha:]][_$[:alnum:]]*\s*=>) |
59
+ ((<([^<>]|\<[^<>]+\>)+>\s*)?\(([^()]|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=>))
60
+ ) |
61
+ (:\s*(
62
+ (<) |
63
+ ([(]\s*(
64
+ ([)]) |
65
+ (\.\.\.) |
66
+ ([_$[:alnum:]]+\s*(
67
+ ([:,?=])|
68
+ ([)]\s*=>)
69
+ ))
70
+ )))
71
+ )
72
+ )
71
73
beginCaptures :
72
74
' 1 ' : { name: meta.definition.variable.ts entity.name.function.ts }
73
75
end : (?=$|[;,=}]|(\s+(of|in)\s+))
@@ -409,8 +411,9 @@ repository:
409
411
patterns :
410
412
- include : ' #comment'
411
413
- comment : (default|*|name) as alias
412
- match : ' (?x) (?: \b(default)\b | (\*) | ([_$[:alpha:]][_$[:alnum:]]*)) \s+
413
- (as) \s+ (?: (\b default \b | \*) | ([_$[:alpha:]][_$[:alnum:]]*))'
414
+ match : |-
415
+ (?x) (?: \b(default)\b | (\*) | ([_$[:alpha:]][_$[:alnum:]]*)) \s+
416
+ (as) \s+ (?: (\b default \b | \*) | ([_$[:alpha:]][_$[:alnum:]]*))
414
417
captures :
415
418
' 1 ' : { name: keyword.control.default.ts }
416
419
' 2 ' : { name: constant.language.import-export-all.ts }
@@ -428,7 +431,7 @@ repository:
428
431
429
432
class-or-interface-declaration :
430
433
name : meta.class.ts
431
- begin : ' (?<!\.|\$)\b(?:(export)\s+)?\b(?:(abstract)\s+)?\b(?:(class)|(interface))\b'
434
+ begin : (?<!\.|\$)\b(?:(export)\s+)?\b(?:(abstract)\s+)?\b(?:(class)|(interface))\b
432
435
beginCaptures :
433
436
' 1 ' : { name: keyword.control.export.ts }
434
437
' 2 ' : { name: storage.modifier.ts }
@@ -447,7 +450,7 @@ repository:
447
450
- include : ' #class-or-interface-body'
448
451
449
452
class-or-interface-heritage :
450
- begin : ' (?<!\.|\$)(?:\b(extends|implements)\b)(?!\$)'
453
+ begin : (?<!\.|\$)(?:\b(extends|implements)\b)(?!\$)
451
454
beginCaptures :
452
455
' 1 ' : { name: storage.modifier.ts }
453
456
end : (?=\{)
@@ -534,25 +537,27 @@ repository:
534
537
- name : meta.definition.property.ts entity.name.function.ts
535
538
# function assignment |
536
539
# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
537
- match : (?x)([_$[:alpha:]][_$[:alnum:]]*)(?=(\?\s*)?\s*
538
- (=\s*(
539
- (async\s+) |
540
- (function\s*[(<]) |
541
- (function\s+) |
542
- ([_$[:alpha:]][_$[:alnum:]]*\s*=>) |
543
- ((<([^<>]|\<[^<>]+\>)+>\s*)?\(([^()]|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=>))
544
- ) |
545
- (:\s*(
546
- (<) |
547
- ([(]\s*(
548
- ([)]) |
549
- (\.\.\.) |
550
- ([_$[:alnum:]]+\s*(
551
- ([:,?=])|
552
- ([)]\s*=>)
553
- ))
554
- )))
555
- ))
540
+ match : |-
541
+ (?x)([_$[:alpha:]][_$[:alnum:]]*)(?=(\?\s*)?\s*
542
+ (=\s*(
543
+ (async\s+) |
544
+ (function\s*[(<]) |
545
+ (function\s+) |
546
+ ([_$[:alpha:]][_$[:alnum:]]*\s*=>) |
547
+ ((<([^<>]|\<[^<>]+\>)+>\s*)?\(([^()]|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=>))
548
+ ) |
549
+ (:\s*(
550
+ (<) |
551
+ ([(]\s*(
552
+ ([)]) |
553
+ (\.\.\.) |
554
+ ([_$[:alnum:]]+\s*(
555
+ ([:,?=])|
556
+ ([)]\s*=>)
557
+ ))
558
+ )))
559
+ )
560
+ )
556
561
- name : meta.definition.property.ts variable.object.property.ts
557
562
match : ' [_$[:alpha:]][_$[:alnum:]]*'
558
563
- name : keyword.operator.optional.ts
@@ -725,25 +730,27 @@ repository:
725
730
patterns :
726
731
# function assignment |
727
732
# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
728
- - match : (?x)(?:\s*\b(readonly)\s+)?(?:\s*\b(public|private|protected)\s+)?(\.\.\.)?\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\s*(\??)(?=\s*
729
- (=\s*(
730
- (async\s+) |
731
- (function\s*[(<]) |
732
- (function\s+) |
733
- ([_$[:alpha:]][_$[:alnum:]]*\s*=>) |
734
- ((<([^<>]|\<[^<>]+\>)+>\s*)?\(([^()]|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=>))
735
- ) |
736
- (:\s*(
737
- (<) |
738
- ([(]\s*(
739
- ([)]) |
740
- (\.\.\.) |
741
- ([_$[:alnum:]]+\s*(
742
- ([:,?=])|
743
- ([)]\s*=>)
744
- ))
745
- )))
746
- ))
733
+ - match : |-
734
+ (?x)(?:\s*\b(readonly)\s+)?(?:\s*\b(public|private|protected)\s+)?(\.\.\.)?\s*(?<!=|:)([_$[:alpha:]][_$[:alnum:]]*)\s*(\??)(?=\s*
735
+ (=\s*(
736
+ (async\s+) |
737
+ (function\s*[(<]) |
738
+ (function\s+) |
739
+ ([_$[:alpha:]][_$[:alnum:]]*\s*=>) |
740
+ ((<([^<>]|\<[^<>]+\>)+>\s*)?\(([^()]|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=>))
741
+ ) |
742
+ (:\s*(
743
+ (<) |
744
+ ([(]\s*(
745
+ ([)]) |
746
+ (\.\.\.) |
747
+ ([_$[:alnum:]]+\s*(
748
+ ([:,?=])|
749
+ ([)]\s*=>)
750
+ ))
751
+ )))
752
+ )
753
+ )
747
754
captures:
748
755
'1': { name: storage.modifier.ts }
749
756
'2': { name: storage.modifier.ts }
@@ -832,7 +839,7 @@ repository:
832
839
833
840
return-type :
834
841
name : meta.return.type.ts
835
- begin : ' (?<=\))\s*(:)'
842
+ begin : (?<=\))\s*(:)
836
843
beginCaptures :
837
844
' 1 ' : { name: keyword.operator.type.annotation.ts }
838
845
end : (?<!:)((?=$)|(?=\{|;|//|\}))
@@ -902,22 +909,22 @@ repository:
902
909
903
910
type-primitive :
904
911
name : support.type.primitive.ts
905
- match : ' (?<!\.|\$)\b(string|number|boolean|symbol|any|void|never)\b(?!\$)'
912
+ match : (?<!\.|\$)\b(string|number|boolean|symbol|any|void|never)\b(?!\$)
906
913
907
914
type-builtin-literals :
908
915
name : support.type.builtin.ts
909
- match : ' (?<!\.|\$)\b(this|true|false|undefined|null)\b(?!\$)'
916
+ match : (?<!\.|\$)\b(this|true|false|undefined|null)\b(?!\$)
910
917
911
918
# Parenthesis can contain either types and function parameters
912
919
# (number | string) or (param: number, param2: string)
913
920
# and it can be nested, for example
914
921
# (number | (param: number, param2: string) => void)
915
922
type-paren-or-function-parameters :
916
923
name : meta.type.paren.cover.ts
917
- begin : ' \( '
924
+ begin : \(
918
925
beginCaptures :
919
926
' 0 ' : { name: meta.brace.round.ts }
920
- end : ' \) '
927
+ end : \)
921
928
endCaptures :
922
929
' 0 ' : { name: meta.brace.round.ts }
923
930
patterns :
@@ -946,18 +953,19 @@ repository:
946
953
- include : ' #function-parameters'
947
954
# () | (... | (param: | (param, | (param? | (param= | (param) =>
948
955
- name : meta.type.function.ts
949
- begin : ' (?x)(
950
- (?=
951
- [(]\s*(
952
- ([)]) |
953
- (\.\.\.) |
954
- ([_$[:alnum:]]+\s*(
955
- ([:,?=])|
956
- ([)]\s*=>)
957
- ))
956
+ begin : |-
957
+ (?x)(
958
+ (?=
959
+ [(]\s*(
960
+ ([)]) |
961
+ (\.\.\.) |
962
+ ([_$[:alnum:]]+\s*(
963
+ ([:,?=])|
964
+ ([)]\s*=>)
965
+ ))
966
+ )
958
967
)
959
968
)
960
- )'
961
969
end : (?<=\))
962
970
patterns :
963
971
- include : ' #function-parameters'
@@ -1023,7 +1031,7 @@ repository:
1023
1031
patterns :
1024
1032
- include : ' #comment'
1025
1033
- name : storage.modifier.ts
1026
- match : ' (?<!\.|\$)\b(extends)\b(?!\$)'
1034
+ match : (?<!\.|\$)\b(extends)\b(?!\$)
1027
1035
- include : ' #type'
1028
1036
- include : ' #punctuation-comma'
1029
1037
@@ -1062,7 +1070,7 @@ repository:
1062
1070
1063
1071
switch-block :
1064
1072
name : switch-block.expr.ts
1065
- begin : ' { '
1073
+ begin : \{
1066
1074
beginCaptures :
1067
1075
' 0 ' : { name: punctuation.definition.block.ts }
1068
1076
end : (?=\})
@@ -1072,7 +1080,7 @@ repository:
1072
1080
1073
1081
case-clause :
1074
1082
name : case-clause.expr.ts
1075
- begin : ' (?<!\.|\$)\b(case|default(?=:))\b(?!\$)'
1083
+ begin : (?<!\.|\$)\b(case|default(?=:))\b(?!\$)
1076
1084
beginCaptures :
1077
1085
' 1 ' : { name: keyword.control.switch.ts }
1078
1086
end : ' :'
@@ -1084,7 +1092,7 @@ repository:
1084
1092
switch-statement :
1085
1093
name : switch-statement.expr.ts
1086
1094
begin : (?<!\.|\$)(?=\bswitch\s*\()
1087
- end : ' } '
1095
+ end : \}
1088
1096
endCaptures :
1089
1097
' 0 ' : {name: punctuation.definition.block.ts}
1090
1098
patterns :
@@ -1097,16 +1105,18 @@ repository:
1097
1105
match : (?<!\.|\$)\b(arguments)\b(?!\$)
1098
1106
# builtins
1099
1107
- name : support.class.builtin.ts
1100
- match : (?x)(?<!\.|\$)\b(Array|ArrayBuffer|Atomics|Boolean|DataView|Date|Float32Array|Float64Array|Function|Generator
1101
- |GeneratorFunction|Int8Array|Int16Array|Int32Array|Intl|Map|Number|Object|Promise|Proxy
1102
- |Reflect|RegExp|Set|SharedArrayBuffer|SIMD|String|Symbol|TypedArray
1103
- |Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|WeakMap|WeakSet)\b(?!\$)
1108
+ match : |-
1109
+ (?x)(?<!\.|\$)\b(Array|ArrayBuffer|Atomics|Boolean|DataView|Date|Float32Array|Float64Array|Function|Generator
1110
+ |GeneratorFunction|Int8Array|Int16Array|Int32Array|Intl|Map|Number|Object|Promise|Proxy
1111
+ |Reflect|RegExp|Set|SharedArrayBuffer|SIMD|String|Symbol|TypedArray
1112
+ |Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|WeakMap|WeakSet)\b(?!\$)
1104
1113
- name : support.class.error.ts
1105
1114
match : (?<!\.|\$)\b((Eval|Internal|Range|Reference|Syntax|Type|URI)?Error)\b(?!\$)
1106
1115
# known builtin function calls
1107
1116
- name : support.function.ts
1108
- match : (?x)(?<!\.|\$)\b(clear(Interval|Timeout)|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|
1109
- isFinite|isNaN|parseFloat|parseInt|require|set(Interval|Timeout)|super|unescape|uneval)(?=\s*\()
1117
+ match : |-
1118
+ (?x)(?<!\.|\$)\b(clear(Interval|Timeout)|decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|
1119
+ isFinite|isNaN|parseFloat|parseInt|require|set(Interval|Timeout)|super|unescape|uneval)(?=\s*\()
1110
1120
# Math
1111
1121
- match : |-
1112
1122
(?x)(?<!\.|\$)\b(Math)(?:\s*(\.)\s*(?:
@@ -1397,10 +1407,11 @@ repository:
1397
1407
'2': { name: constant.other.object.property.ts }
1398
1408
'3': { name: variable.other.object.property.ts }
1399
1409
# function and method assignment
1400
- - match : (?x)(?:(\.)\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\s*=\s*(
1401
- (async\s+)|(function\s*[(<])|(function\s+)|
1402
- ([_$[:alpha:]][_$[:alnum:]]*\s*=>)|
1403
- ((<([^<>]|\<[^<>]+\>)+>\s*)?\(([^()]|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=>)))
1410
+ - match : |-
1411
+ (?x)(?:(\.)\s*)?([_$[:alpha:]][_$[:alnum:]]*)(?=\s*=\s*(
1412
+ (async\s+)|(function\s*[(<])|(function\s+)|
1413
+ ([_$[:alpha:]][_$[:alnum:]]*\s*=>)|
1414
+ ((<([^<>]|\<[^<>]+\>)+>\s*)?\(([^()]|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=>)))
1404
1415
captures:
1405
1416
'1': { name: punctuation.accessor.ts }
1406
1417
'2': { name: entity.name.function.ts }
@@ -1436,21 +1447,21 @@ repository:
1436
1447
# If '<' is preceeded by 'return', 'throw', 'yield', or 'await', it's most likely a type assertion
1437
1448
# If '=', '(', ',', ':', or '>' are followed by a '<', it is also likely a type assertion as otherwise it would be a syntax error
1438
1449
# '<=' and '<<=' are cannot be type assertions, as they are assignment operators.
1439
- begin : ' (?:(?<=return|throw|yield|await|default|[=(,:>*]))\s*(<)(?!<?\=)'
1450
+ begin : (?:(?<=return|throw|yield|await|default|[=(,:>*]))\s*(<)(?!<?\=)
1440
1451
beginCaptures :
1441
1452
' 1 ' : { name: meta.brace.angle.ts }
1442
- end : ' > '
1453
+ end : \>
1443
1454
endCaptures :
1444
1455
' 0 ' : { name: meta.brace.angle.ts }
1445
1456
patterns :
1446
1457
- include : ' #type'
1447
1458
1448
1459
new-expr :
1449
1460
name : new.expr.ts
1450
- begin : ' (?<!\.|\$)\b(new)\b(?!\$)'
1461
+ begin : (?<!\.|\$)\b(new)\b(?!\$)
1451
1462
beginCaptures :
1452
1463
' 1 ' : { name: keyword.operator.new.ts }
1453
- end : ' (?<=\))|(?=[;),]|$|((?<!\.|\$)\bnew\b(?!\$)))'
1464
+ end : (?<=\))|(?=[;),]|$|((?<!\.|\$)\bnew\b(?!\$)))
1454
1465
patterns :
1455
1466
- include : ' #paren-expression'
1456
1467
- include : ' #class-or-interface-declaration'
@@ -1474,10 +1485,11 @@ repository:
1474
1485
- include : ' #array-literal'
1475
1486
- include : ' #expression'
1476
1487
- name : meta.object.member.ts
1477
- begin : (?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\s*(:)(?=\s*(
1478
- (async\s+)|(function\s*[(<])|(function\s+)|
1479
- ([_$[:alpha:]][_$[:alnum:]]*\s*=>)|
1480
- ((<([^<>]|\<[^<>]+\>)+>\s*)?\(([^()]|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=>))))
1488
+ begin : |-
1489
+ (?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\s*(:)(?=\s*(
1490
+ (async\s+)|(function\s*[(<])|(function\s+)|
1491
+ ([_$[:alpha:]][_$[:alnum:]]*\s*=>)|
1492
+ ((<([^<>]|\<[^<>]+\>)+>\s*)?\(([^()]|\([^()]*\))*\)(\s*:\s*(.)*)?\s*=>))))
1481
1493
beginCaptures :
1482
1494
' 0 ' : { name: meta.object-literal.key.ts }
1483
1495
' 1 ' : { name: entity.name.function.ts }
@@ -1912,7 +1924,7 @@ repository:
1912
1924
- name : entity.other.attribute-name.directive.ts
1913
1925
match : ' path|types|no-default-lib|name'
1914
1926
- name : keyword.operator.assignment.ts
1915
- match : =
1927
+ match : ' = '
1916
1928
- include : ' #string'
1917
1929
1918
1930
docblock :
0 commit comments