@@ -8,6 +8,57 @@ uuid: ef98eb90-bf9b-11e4-bb52-0800200c9a66
8
8
variables :
9
9
identifier : ' [_$[:alpha:]][_$[:alnum:]]*'
10
10
constantIdentifier : ' [[:upper:]][_$[:digit:][:upper:]]*'
11
+ quotedStrings : (\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")
12
+ nonIdentifierPropertyName : ' {{quotedStrings}}|(\[([^\[\]]|\[[^\[\]]*\])+\])'
13
+ propertyName : (({{identifier}})|{{nonIdentifierPropertyName}})
14
+ constantVar : ({{constantIdentifier}})(?![_$[:alnum:]])
15
+ typeParameters : (<\s*[_$[:alpha:]\{\(]([^<>=]|=[^<]|\<\s*[_$[:alpha:]\{\(]([^=<>]|=[^<])+\>)+>\s*)
16
+ arrowLookup : |-
17
+ # sure shot arrow functions even if => is on new line
18
+ (
19
+ [(]\s*
20
+ (
21
+ ([)]\s*:) | # ():
22
+ ((\.\.\.\s*)?{{identifier}}\s*:) # [(]param: | [(]...param:
23
+ )
24
+ ) |
25
+ (
26
+ [<]\s*{{identifier}}\s+extends\s*[^=>] # < typeparam extends
27
+ ) |
28
+ # arrow function possible to detect only with => on same line
29
+ (
30
+ {{typeParameters}}? # typeparameters
31
+ \((\s*[_$[:alpha:]\{\(]([^()]|\((\s*[_$[:alpha:]\{\(]\{\(][^()]*)?\))*)?\) # parameteres
32
+ (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
33
+ \s*=> # arrow operator
34
+ )
35
+ functionOrArrowLookup : |-
36
+ \s*(
37
+ ((async\s+)?(
38
+ (function\s*[(<*]) |
39
+ (function\s+) |
40
+ ({{identifier}}\s*=>)
41
+ )) |
42
+ ((async\s*)?(
43
+ {{arrowLookup}}
44
+ ))
45
+ )
46
+ functionLikeAssignmentOrType : |-
47
+ \s*
48
+ # function assignment |
49
+ (={{functionOrArrowLookup}}) |
50
+ # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
51
+ (:\s*(
52
+ (<) |
53
+ ([(]\s*(
54
+ ([)]) |
55
+ (\.\.\.) |
56
+ ([_$[:alnum:]]+\s*(
57
+ ([:,?=])|
58
+ ([)]\s*=>)
59
+ ))
60
+ ))
61
+ ))
11
62
12
63
patterns :
13
64
- include : ' #directives'
@@ -124,41 +175,15 @@ repository:
124
175
var-single-variable :
125
176
patterns :
126
177
- name : meta.var-single-variable.expr.ts
127
- # function assignment |
128
- # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
129
178
begin : |-
130
- (?x)({{identifier}})(?=\s*
131
- (=\s*(
132
- ((async\s+)?(
133
- (function\s*[(<*]) |
134
- (function\s+) |
135
- ({{identifier}}\s*=>)
136
- )) |
137
- ((async\s*)?(
138
- ([(]\s*(([)]\s*:)|({{identifier}}\s*:)|(\.\.\.) )) |
139
- ([<]\s*{{identifier}}((\s+extends\s*[^=>])|(\s*[,]))) |
140
- ((<\s*[_$[:alpha:]\{\(]([^<>=]|=[^<]|\<\s*[_$[:alpha:]\{\(]([^=<>]|=[^<])+\>)+>\s*)?\((\s*[_$[:alpha:]\{\(]([^()]|\((\s*[_$[:alpha:]\{\(]\{\(][^()]*)?\))*)?\)(\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)?\s*=>)
141
- ))
142
- )) |
143
- (:\s*(
144
- (<) |
145
- ([(]\s*(
146
- ([)]) |
147
- (\.\.\.) |
148
- ([_$[:alnum:]]+\s*(
149
- ([:,?=])|
150
- ([)]\s*=>)
151
- ))
152
- ))
153
- ))
154
- )
179
+ (?x)({{identifier}})(?={{functionLikeAssignmentOrType}})
155
180
beginCaptures :
156
181
' 1 ' : { name: meta.definition.variable.ts entity.name.function.ts }
157
182
end : (?=$|^|[;,=}]|(\s+(of|in)\s+))
158
183
patterns :
159
184
- include : ' #var-single-variable-type-annotation'
160
185
- name : meta.var-single-variable.expr.ts
161
- begin : ({{constantIdentifier}})(?![_$[:alnum:]])
186
+ begin : ' {{constantVar}} '
162
187
beginCaptures :
163
188
' 1 ' : { name: meta.definition.variable.ts variable.other.constant.ts }
164
189
end : (?=$|^|[;,=}]|(\s+(of|in)\s+))
@@ -198,7 +223,7 @@ repository:
198
223
object-binding-element :
199
224
patterns :
200
225
- include : ' #comment'
201
- - begin : (?=(({{identifier}})|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\])) \s*(:))
226
+ - begin : (?={{propertyName}} \s*(:))
202
227
end : (?=,|\})
203
228
patterns :
204
229
- include : ' #object-binding-element-propertyName'
@@ -209,7 +234,7 @@ repository:
209
234
- include : ' #punctuation-comma'
210
235
211
236
object-binding-element-propertyName :
212
- begin : (?=(({{identifier}})|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\])) \s*(:))
237
+ begin : (?={{propertyName}} \s*(:))
213
238
end : (:)
214
239
endCaptures :
215
240
' 0 ' : { name: punctuation.destructuring.ts }
@@ -261,34 +286,8 @@ repository:
261
286
- match : \s*\b(public|protected|private|readonly)(?=\s+(public|protected|private|readonly)\s+)
262
287
captures :
263
288
' 1 ' : { name: storage.modifier.ts }
264
- # function assignment |
265
- # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
266
289
- match : |-
267
- (?x)(?:\s*\b(public|private|protected|readonly)\s+)?(\.\.\.)?\s*(?<!=|:)(?:(this)|({{identifier}}))\s*(\??)(?=\s*
268
- (=\s*(
269
- ((async\s+)?(
270
- (function\s*[(<*]) |
271
- (function\s+) |
272
- ({{identifier}}\s*=>)
273
- )) |
274
- ((async\s*)?(
275
- ([(]\s*(([)]\s*:)|({{identifier}}\s*:)|(\.\.\.) )) |
276
- ([<]\s*{{identifier}}((\s+extends\s*[^=>])|(\s*[,]))) |
277
- ((<\s*[_$[:alpha:]\{\(]([^<>=]|=[^<]|\<\s*[_$[:alpha:]\{\(]([^=<>]|=[^<])+\>)+>\s*)?\((\s*[_$[:alpha:]\{\(]([^()]|\((\s*[_$[:alpha:]\{\(]\{\(][^()]*)?\))*)?\)(\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)?\s*=>)
278
- ))
279
- )) |
280
- (:\s*(
281
- (<) |
282
- ([(]\s*(
283
- ([)]) |
284
- (\.\.\.) |
285
- ([_$[:alnum:]]+\s*(
286
- ([:,?=])|
287
- ([)]\s*=>)
288
- ))
289
- ))
290
- ))
291
- )
290
+ (?x)(?:\s*\b(public|private|protected|readonly)\s+)?(\.\.\.)?\s*(?<!=|:)(?:(this)|({{identifier}}))\s*(\??)(?={{functionLikeAssignmentOrType}})
292
291
captures:
293
292
'1': { name: storage.modifier.ts }
294
293
'2': { name: keyword.operator.rest.ts }
@@ -328,7 +327,7 @@ repository:
328
327
parameter-object-binding-element :
329
328
patterns :
330
329
- include : ' #comment'
331
- - begin : (?=(({{identifier}})|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\])) \s*(:))
330
+ - begin : (?={{propertyName}} \s*(:))
332
331
end : (?=,|\})
333
332
patterns :
334
333
- include : ' #object-binding-element-propertyName'
@@ -377,14 +376,14 @@ repository:
377
376
378
377
field-declaration :
379
378
name : meta.field.declaration.ts
380
- begin : (?<!\()(?:(?<!\.|\$)\b(readonly)\s+)?(?=(({{identifier}})|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\])) \s*(\?\s*)?(=|:))
379
+ begin : (?<!\()(?:(?<!\.|\$)\b(readonly)\s+)?(?={{propertyName}} \s*(\?\s*)?(=|:))
381
380
beginCaptures :
382
381
' 1 ' : { name: storage.modifier.ts }
383
- end : (?=\}|;|,|$|(^(?!(({{identifier}})|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\])) \s*(\?\s*)?(=|:))))|(?<=\})
382
+ end : (?=\}|;|,|$|(^(?!{{propertyName}} \s*(\?\s*)?(=|:))))|(?<=\})
384
383
patterns :
385
384
- include : ' #variable-initializer'
386
- - begin : (?=((?:{{identifier}})|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\])) \s*(\?\s*)?(=|:))
387
- end : (?=[};,=]|$|(^(?!(({{identifier}})|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\])) \s*(\?\s*)?(=|:))))|(?<=\})
385
+ - begin : (?={{propertyName}} \s*(\?\s*)?(=|:))
386
+ end : (?=[};,=]|$|(^(?!{{propertyName}} \s*(\?\s*)?(=|:))))|(?<=\})
388
387
patterns :
389
388
- include : ' #type-annotation'
390
389
- include : ' #string'
@@ -394,31 +393,7 @@ repository:
394
393
# function assignment |
395
394
# typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
396
395
match : |-
397
- (?x)({{identifier}})(?=(\?\s*)?\s*
398
- (=\s*(
399
- ((async\s+)?(
400
- (function\s*[(<*]) |
401
- (function\s+) |
402
- ({{identifier}}\s*=>)
403
- )) |
404
- ((async\s*)?(
405
- ([(]\s*(([)]\s*:)|({{identifier}}\s*:)|(\.\.\.) )) |
406
- ([<]\s*{{identifier}}((\s+extends\s*[^=>])|(\s*[,]))) |
407
- ((<\s*[_$[:alpha:]\{\(]([^<>=]|=[^<]|\<\s*[_$[:alpha:]\{\(]([^=<>]|=[^<])+\>)+>\s*)?\((\s*[_$[:alpha:]\{\(]([^()]|\((\s*[_$[:alpha:]\{\(]\{\(][^()]*)?\))*)?\)(\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)?\s*=>)
408
- ))
409
- )) |
410
- (:\s*(
411
- (<) |
412
- ([(]\s*(
413
- ([)]) |
414
- (\.\.\.) |
415
- ([_$[:alnum:]]+\s*(
416
- ([:,?=])|
417
- ([)]\s*=>)
418
- ))
419
- ))
420
- ))
421
- )
396
+ (?x)({{identifier}})(?=(\?\s*)?{{functionLikeAssignmentOrType}})
422
397
- name : meta.definition.property.ts variable.object.property.ts
423
398
match : ' {{identifier}}'
424
399
- name : keyword.operator.optional.ts
@@ -479,7 +454,7 @@ repository:
479
454
patterns :
480
455
# method, accessor
481
456
- name : meta.method.declaration.ts
482
- begin : (?<!\.|\$)(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)(?:(\*)\s*)?(?=((({{identifier}})|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\])) \s*(\??))\s*[\(\<])
457
+ begin : (?<!\.|\$)(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)(?:(\*)\s*)?(?=({{propertyName}} \s*(\??))\s*[\(\<])
483
458
beginCaptures :
484
459
' 1 ' : { name: storage.modifier.ts } # captures keyword (public or private or protected)
485
460
' 2 ' : { name: storage.modifier.ts } # captures keyword (abstract)
@@ -492,7 +467,7 @@ repository:
492
467
- include : ' #function-body'
493
468
# new, constructor or call signature
494
469
- name : meta.method.declaration.ts
495
- begin : (?<!\.|\$)(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:(?:\b(?:(new)|(constructor))\b(?!\$|\.|:))|(?:(\*)\s*)?(?=((({{identifier}})|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\])) \s*(\??))?\s*[\(\<]))
470
+ begin : (?<!\.|\$)(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:(?:\b(?:(new)|(constructor))\b(?!\$|\.|:))|(?:(\*)\s*)?(?=({{propertyName}} \s*(\??))?\s*[\(\<]))
496
471
beginCaptures :
497
472
' 1 ' : { name: storage.modifier.ts } # captures keyword (public or private or protected)
498
473
' 2 ' : { name: storage.modifier.ts } # captures keyword (abstract)
@@ -507,7 +482,7 @@ repository:
507
482
508
483
object-literal-method-declaration :
509
484
name : meta.method.declaration.ts
510
- begin : (?<!\.|\$)(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=((({{identifier}})|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\])) \s*(\??))\s*[\(\<])
485
+ begin : (?<!\.|\$)(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=({{propertyName}} \s*(\??))\s*[\(\<])
511
486
beginCaptures :
512
487
' 1 ' : { name: storage.modifier.async.ts } # captures keyword (async)
513
488
' 2 ' : { name: storage.type.property.ts } # captures keyword (get|set)
@@ -516,7 +491,7 @@ repository:
516
491
patterns :
517
492
- include : ' #method-declaration-name'
518
493
- include : ' #function-body'
519
- - begin : (?<!\.|\$)(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=((({{identifier}})|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\])) \s*(\??))\s*[\(\<])
494
+ - begin : (?<!\.|\$)(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=({{propertyName}} \s*(\??))\s*[\(\<])
520
495
beginCaptures :
521
496
' 1 ' : { name: storage.modifier.async.ts } # captures keyword (async)
522
497
' 2 ' : { name: storage.type.property.ts } # captures keyword (get|set)
@@ -526,7 +501,7 @@ repository:
526
501
- include : ' #method-declaration-name'
527
502
528
503
method-declaration-name :
529
- begin : (?=(({{identifier}})|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\])) \s*(\??)\s*[\(\<])
504
+ begin : (?={{propertyName}} \s*(\??)\s*[\(\<])
530
505
end : (?=\(|\<)
531
506
patterns :
532
507
- include : ' #string'
@@ -553,24 +528,7 @@ repository:
553
528
)?
554
529
((?<![})!\]])\s*
555
530
(?=
556
- # sure shot arrow functions even if => is on new line
557
- (
558
- [(]\s*
559
- (
560
- ([)]\s*:) | # ():
561
- ((\.\.\.\s*)?{{identifier}}\s*:) # [(]param: | [(]...param:
562
- )
563
- ) |
564
- (
565
- [<]\s*{{identifier}}\s+extends\s*[^=>] # < typeparam extends
566
- ) |
567
- # arrow function possible to detect only with => on same line
568
- (
569
- (<\s*[_$[:alpha:]\{\(]([^<>=]|=[^<]|\<\s*[_$[:alpha:]\{\(]([^=<>]|=[^<])+\>)+>\s*)? # typeparameters
570
- \((\s*[_$[:alpha:]\{\(]([^()]|\((\s*[_$[:alpha:]\{\(]\{\(][^()]*)?\))*)?\) # parameteres
571
- (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
572
- \s*=> # arrow operator
573
- )
531
+ {{arrowLookup}}
574
532
)
575
533
)
576
534
beginCaptures :
@@ -767,7 +725,7 @@ repository:
767
725
patterns :
768
726
- include : ' #comment'
769
727
- include : ' #variable-initializer'
770
- - begin : (?=((\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]) ))
728
+ - begin : (?=({{nonIdentifierPropertyName}} ))
771
729
end : (?=,|\}|$)
772
730
patterns :
773
731
- include : ' #string'
@@ -1026,18 +984,7 @@ repository:
1026
984
' 1 ' : { name: constant.numeric.decimal.ts }
1027
985
- name : meta.object.member.ts
1028
986
match : |-
1029
- (?x)(?:({{identifier}})\s*(?=:\s*(
1030
- ((async\s+)?(
1031
- (function\s*[(<*]) |
1032
- (function\s+) |
1033
- ({{identifier}}\s*=>)
1034
- )) |
1035
- ((async\s*)?(
1036
- ([(]\s*(([)]\s*:)|({{identifier}}\s*:)|(\.\.\.) )) |
1037
- ([<]\s*{{identifier}}((\s+extends\s*[^=>])|(\s*[,]))) |
1038
- ((<\s*[_$[:alpha:]\{\(]([^<>=]|=[^<]|\<\s*[_$[:alpha:]\{\(]([^=<>]|=[^<])+\>)+>\s*)?\((\s*[_$[:alpha:]\{\(]([^()]|\((\s*[_$[:alpha:]\{\(]\{\(][^()]*)?\))*)?\)(\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)?\s*=>)
1039
- ))
1040
- )))
987
+ (?x)(?:({{identifier}})\s*(?=:{{functionOrArrowLookup}}))
1041
988
captures :
1042
989
' 0 ' : { name: meta.object-literal.key.ts }
1043
990
' 1 ' : { name: entity.name.function.ts }
@@ -1084,12 +1031,12 @@ repository:
1084
1031
1085
1032
# function call and new expression
1086
1033
function-call :
1087
- begin : (?=(({{identifier}}\s*\.\s*)*|(\.\s*)?)({{identifier}})\s*(<\s*[_$[:alpha:]\{\(]([^<>=]|=[^<]|\<\s*[_$[:alpha:]\{\(]([^=<>]|=[^<])+\>)+>\s*) ?\()
1088
- end : (?<=\))(?!(({{identifier}}\s*\.\s*)*|(\.\s*)?)({{identifier}})\s*(<\s*[_$[:alpha:]\{\(]([^<>=]|=[^<]|\<\s*[_$[:alpha:]\{\(]([^=<>]|=[^<])+\>)+>\s*) ?\()
1034
+ begin : (?=(({{identifier}}\s*\.\s*)*|(\.\s*)?)({{identifier}})\s*{{typeParameters}} ?\()
1035
+ end : (?<=\))(?!(({{identifier}}\s*\.\s*)*|(\.\s*)?)({{identifier}})\s*{{typeParameters}} ?\()
1089
1036
patterns :
1090
1037
- name : meta.function-call.ts
1091
1038
begin : (?=(({{identifier}}\s*\.\s*)*|(\.\s*)?)({{identifier}}))
1092
- end : (?=\s*(<\s*[_$[:alpha:]\{\(]([^<>=]|=[^<]|\<\s*[_$[:alpha:]\{\(]([^=<>]|=[^<])+\>)+>\s*) ?\()
1039
+ end : (?=\s*{{typeParameters}} ?\()
1093
1040
patterns :
1094
1041
- include : ' #literal'
1095
1042
- include : ' #support-objects'
@@ -1264,7 +1211,7 @@ repository:
1264
1211
(?:\b[0-9]+(\.)[0-9]+[eE][+-]?[0-9]+\b)| # 1.1E+3
1265
1212
(?:\b[0-9]+(\.)[eE][+-]?[0-9]+\b)| # 1.E+3
1266
1213
(?:\B(\.)[0-9]+[eE][+-]?[0-9]+\b)| # .1E+3
1267
- (?:\b[0-9]+[eE][+-]?[0-9]+\b)| # 1E+3
1214
+ (?:\b[0-9]+[eE][+-]?[0-9]+\b)| # 1E+3
1268
1215
(?:\b[0-9]+(\.)[0-9]+\b)| # 1.1
1269
1216
(?:\b[0-9]+(\.)\B)| # 1.
1270
1217
(?:\B(\.)[0-9]+\b)| # .1
@@ -1464,7 +1411,7 @@ repository:
1464
1411
|siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary
1465
1412
|systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead
1466
1413
|title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile
1467
- |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\b(?!\$|\s*(<\s*[_$[:alpha:]\{\(]([^<>=]|=[^<]|\<\s*[_$[:alpha:]\{\(]([^=<>]|=[^<])+\>)+>\s*) ?\()
1414
+ |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\b(?!\$|\s*{{typeParameters}} ?\()
1468
1415
captures:
1469
1416
'1': { name: punctuation.accessor.ts }
1470
1417
'2': { name: support.constant.dom.ts }
@@ -1581,23 +1528,12 @@ repository:
1581
1528
- include : ' #object-identifiers'
1582
1529
# function and method assignment
1583
1530
- match : |-
1584
- (?x)(?:(\.)\s*)?({{identifier}})(?=\s*=\s*(
1585
- ((async\s+)?(
1586
- (function\s*[(<*]) |
1587
- (function\s+) |
1588
- ({{identifier}}\s*=>)
1589
- )) |
1590
- ((async\s*)?(
1591
- ([(]\s*(([)]\s*:)|({{identifier}}\s*:)|(\.\.\.) )) |
1592
- ([<]\s*{{identifier}}((\s+extends\s*[^=>])|(\s*[,]))) |
1593
- ((<\s*[_$[:alpha:]\{\(]([^<>=]|=[^<]|\<\s*[_$[:alpha:]\{\(]([^=<>]|=[^<])+\>)+>\s*)?\((\s*[_$[:alpha:]\{\(]([^()]|\((\s*[_$[:alpha:]\{\(]\{\(][^()]*)?\))*)?\)(\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)?\s*=>)
1594
- ))
1595
- ))
1531
+ (?x)(?:(\.)\s*)?({{identifier}})(?=\s*={{functionOrArrowLookup}})
1596
1532
captures:
1597
1533
'1': { name: punctuation.accessor.ts }
1598
1534
'2': { name: entity.name.function.ts }
1599
1535
# const properties
1600
- - match : (\.)\s*({{constantIdentifier}})(?![_$[:alnum:]])
1536
+ - match : (\.)\s*{{constantVar}}
1601
1537
captures :
1602
1538
' 1 ' : { name: punctuation.accessor.ts }
1603
1539
' 2 ' : { name: variable.other.constant.property.ts }
@@ -1608,7 +1544,7 @@ repository:
1608
1544
' 2 ' : { name: variable.other.property.ts }
1609
1545
# const
1610
1546
- name : variable.other.constant.ts
1611
- match : ({{constantIdentifier}})(?![_$[:alnum:]])
1547
+ match : ' {{constantVar}} '
1612
1548
# vars
1613
1549
- name : variable.other.readwrite.ts
1614
1550
match : ' {{identifier}}'
@@ -2094,7 +2030,7 @@ repository:
2094
2030
2095
2031
directives :
2096
2032
name : comment.line.triple-slash.directive.ts
2097
- begin : ^(///)\s*(?=<(reference|amd-dependency|amd-module)(\s+(path|types|no-default-lib|name)\s*=\s*((\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\") ))+\s*/>\s*$)
2033
+ begin : ^(///)\s*(?=<(reference|amd-dependency|amd-module)(\s+(path|types|no-default-lib|name)\s*=\s*({{quotedStrings}} ))+\s*/>\s*$)
2098
2034
beginCaptures :
2099
2035
' 1 ' : { name: punctuation.definition.comment.ts }
2100
2036
end : (?=^)
0 commit comments