Skip to content

Commit 6e8a383

Browse files
committed
Fix the lookbehind for multiline arrow to include return keyword
Fixes #672
1 parent 5158d13 commit 6e8a383

File tree

5 files changed

+391
-3
lines changed

5 files changed

+391
-3
lines changed

TypeScript.YAML-tmLanguage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ variables:
5757
inlineComment: \/\*([^\*]|(\*[^\/]))*\*\/
5858
startOfDeclaration: '{{startOfIdentifier}}(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?'
5959
lookBehindOfPossiblyMultilineArrowWithDestructuring: (?<=[(=,])
60-
lookBehindOfPossiblyMultilineArrow: (?<=[(=,]|=>)
60+
lookBehindOfPossiblyMultilineArrow: (?<=[(=,]|=>|{{lookBehindReturn}})
6161
lookBehindOfObjectMemberPossiblyMultilineArrow: (?<=:)
6262
# Identifier start | matching braces | matching parenthesis | matching square brackets
6363
typeParamersStart: ([_$[:alpha:]]|{{matchingBraces}}|{{matchingParenthesis}}|{{matchingBrackets}})

TypeScript.tmLanguage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4538,7 +4538,7 @@
45384538
</dict>
45394539
<dict>
45404540
<key>begin</key>
4541-
<string>(?&lt;=[(=,]|=&gt;)\s*(async)?(?=\s*((((&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;]|\&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;])*\&gt;)*&gt;\s*))?\()|(&lt;))\s*$)</string>
4541+
<string>(?&lt;=[(=,]|=&gt;|^return|[^\._$[:alnum:]]return)\s*(async)?(?=\s*((((&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;]|\&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;])*\&gt;)*&gt;\s*))?\()|(&lt;))\s*$)</string>
45424542
<key>beginCaptures</key>
45434543
<dict>
45444544
<key>1</key>

TypeScriptReact.tmLanguage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4542,7 +4542,7 @@
45424542
</dict>
45434543
<dict>
45444544
<key>begin</key>
4545-
<string>(?&lt;=[(=,]|=&gt;)\s*(async)?(?=\s*((((&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;]|\&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;])*\&gt;)*&gt;\s*))?\()|(&lt;))\s*$)</string>
4545+
<string>(?&lt;=[(=,]|=&gt;|^return|[^\._$[:alnum:]]return)\s*(async)?(?=\s*((((&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;]|\&lt;\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=&lt;&gt;]|=[^&lt;])*\&gt;)*&gt;\s*))?\()|(&lt;))\s*$)</string>
45464546
<key>beginCaptures</key>
45474547
<dict>
45484548
<key>1</key>

0 commit comments

Comments
 (0)