@@ -94,11 +94,7 @@ variables:
9494 {{arrowLookup}}
9595 ))
9696 )
97- functionLikeAssignmentOrType : |-
98- \s*
99- # function assignment |
100- (={{functionOrArrowLookup}}) |
101- # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
97+ functionLikeType : |-
10298 (:\s*(
10399 (<) |
104100 ([(]\s*(
@@ -110,6 +106,13 @@ variables:
110106 ))
111107 ))
112108 )) |
109+ (:\s*{{possiblyMultilineArrow}})
110+ functionLikeAssignmentOrType : |-
111+ \s*
112+ # function assignment |
113+ (={{functionOrArrowLookup}}) |
114+ # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
115+ {{functionLikeType}} |
113116 (:\s*(=>|{{matchingParenthesis}}|(<[^<>]*>)|[^<>(),=])+={{functionOrArrowLookup}})
114117 arrowFunctionEnd : (?==>|\{|(^\s*(export|function|class|interface|let|var|const|import|enum|namespace|module|type|abstract|declare)\s+))
115118
@@ -2027,8 +2030,28 @@ repository:
20272030 endCaptures :
20282031 ' 0 ' : { name: meta.brace.round.ts }
20292032 patterns :
2033+ - include : ' #destructuring-parameter'
2034+ # parameter name only if followed by type annotation
2035+ - match : |-
2036+ (?x)(?:{{startOfIdentifier}}(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:){{startOfIdentifier}}(?:(this)|({{identifier}}))\s*(\??)(?=\s*{{functionLikeType}})
2037+ captures:
2038+ '1': { name: storage.modifier.ts }
2039+ '2': { name: keyword.operator.rest.ts }
2040+ '3': { name: entity.name.function.ts variable.language.this.ts }
2041+ '4': { name: entity.name.function.ts }
2042+ '5': { name: keyword.operator.optional.ts }
2043+ - match : |-
2044+ (?x)(?:{{startOfIdentifier}}(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:){{startOfIdentifier}}(?:(this)|({{identifier}}))\s*(\??)(?=:)
2045+ captures:
2046+ '1': { name: storage.modifier.ts }
2047+ '2': { name: keyword.operator.rest.ts }
2048+ '3': { name: variable.parameter.ts variable.language.this.ts }
2049+ '4': { name: variable.parameter.ts }
2050+ '5': { name: keyword.operator.optional.ts }
2051+ - include : ' #type-annotation'
2052+ - name : punctuation.separator.parameter.ts
2053+ match : ' ,'
20302054 - include : ' #type'
2031- - include : ' #function-parameters'
20322055
20332056 type-fn-type-parameters :
20342057 patterns :
0 commit comments