@@ -69,8 +69,11 @@ variables:
69
69
typeArgumentsStart : (((keyof|infer|awaited|typeof|readonly)\s+)|(({{identifier}}|{{matchingBraces}}|{{matchingParenthesis}}|{{matchingBrackets}}|{{quotedStrings}})(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))
70
70
typeArgumentsInnerExpressionPart : ' [^<>\(]|{{matchingParenthesis}}|(?<==)\>'
71
71
typeArguments : ' <\s*{{typeArgumentsStart}}({{typeArgumentsInnerExpressionPart}}|\<\s*{{typeArgumentsStart}}(({{typeArgumentsInnerExpressionPart}}|\<\s*{{typeArgumentsStart}}({{typeArgumentsInnerExpressionPart}})*(?<!=)\>))*(?<!=)\>)*(?<!=)>'
72
- possiblyMultilineTypeArgumnet : (<\s*[\{\[\(]\s*$)
73
- functionCallLookup : \s*(?:(\?\.\s*)|(\!))?((({{typeArguments}}\s*)?\()|{{possiblyMultilineTypeArgumnet}})
72
+ possiblyMultilineTypeArgument : (<\s*[\{\[\(]\s*$)
73
+ functionCallLookup : \s*(?:(\?\.\s*)|(\!))?(({{typeArguments}}\s*)?\()
74
+ functionCallNamedTarget : (({{identifier}})(\s*{{propertyAccessPreIdentifier}}({{propertyIdentifier}}))*)|({{propertyAccessPreIdentifier}}{{propertyIdentifier}})
75
+ functionCallTarget : (({{functionCallNamedTarget}})|(?<=[\)]))
76
+ possiblyMultilineCallWithTypeArguments : \s*(?:(\?\.\s*)|(\!))?{{possiblyMultilineTypeArgument}}
74
77
possiblyType : \s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+
75
78
typeparamertStartOfArrow : ' '
76
79
arrowLookup : |-
@@ -1458,23 +1461,43 @@ repository:
1458
1461
1459
1462
# function call and new expression
1460
1463
function-call :
1461
- begin : (?=(((({{identifier}})(\s*{{propertyAccessPreIdentifier}}({{propertyIdentifier}}))*)|({{propertyAccessPreIdentifier}}{{propertyIdentifier}}))|(?<=[\)])){{functionCallLookup}})
1462
- end : (?<=\))(?!(((({{identifier}})(\s*{{propertyAccessPreIdentifier}}({{propertyIdentifier}}))*)|({{propertyAccessPreIdentifier}}{{propertyIdentifier}}))|(?<=[\)])){{functionCallLookup}})
1463
1464
patterns :
1464
- - name : meta.function-call.ts
1465
- begin : (?=(({{identifier}})(\s*{{propertyAccessPreIdentifier}}({{propertyIdentifier}}))*)|({{propertyAccessPreIdentifier}}{{propertyIdentifier}}))
1466
- end : (?={{functionCallLookup}})
1465
+ - begin : (?={{functionCallTarget}}{{functionCallLookup}})
1466
+ end : (?<=\))(?!{{functionCallTarget}}{{functionCallLookup}})
1467
1467
patterns :
1468
- - include : ' #support-function-call-identifiers'
1469
- - name : entity.name.function.ts
1470
- match : ({{propertyIdentifier}})
1471
- - include : ' #comment'
1468
+ - name : meta.function-call.ts
1469
+ begin : (?={{functionCallNamedTarget}})
1470
+ end : (?={{functionCallLookup}})
1471
+ patterns :
1472
+ - include : ' #function-call-target'
1473
+ - include : ' #comment'
1474
+ - include : ' #function-call-optionals'
1475
+ - include : ' #type-arguments'
1476
+ - include : ' #paren-expression'
1477
+ - begin : (?={{functionCallTarget}}{{possiblyMultilineTypeArgument}})
1478
+ end : (?<=\>)(?!{{functionCallTarget}}{{possiblyMultilineTypeArgument}})
1479
+ patterns :
1480
+ - name : meta.function-call.ts
1481
+ begin : (?={{functionCallNamedTarget}})
1482
+ end : (?={{possiblyMultilineTypeArgument}})
1483
+ patterns :
1484
+ - include : ' #function-call-target'
1485
+ - include : ' #comment'
1486
+ - include : ' #function-call-optionals'
1487
+ - include : ' #type-arguments'
1488
+
1489
+ function-call-target :
1490
+ patterns :
1491
+ - include : ' #support-function-call-identifiers'
1492
+ - name : entity.name.function.ts
1493
+ match : ({{propertyIdentifier}})
1494
+
1495
+ function-call-optionals :
1496
+ patterns :
1472
1497
- name : meta.function-call.ts punctuation.accessor.optional.ts
1473
1498
match : \?\.
1474
1499
- name : meta.function-call.ts keyword.operator.definiteassignment.ts
1475
1500
match : \!
1476
- - include : ' #type-arguments'
1477
- - include : ' #paren-expression'
1478
1501
1479
1502
support-function-call-identifiers :
1480
1503
patterns :
0 commit comments