Skip to content

Commit 72cb5cd

Browse files
committed
Handle inline comment inside arrow parenthesis
Fixes #686
1 parent c6c261f commit 72cb5cd

File tree

5 files changed

+130
-46
lines changed

5 files changed

+130
-46
lines changed

TypeScript.YAML-tmLanguage

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ variables:
7272
# sure shot arrow functions even if => is on new line
7373
(
7474
{{typeParameters}}?
75-
[(]\s*
75+
[(]\s*({{inlineComment}}\s*)*
7676
(
7777
([)]\s*:) | # ():
7878
((\.\.\.\s*)?{{identifier}}\s*:) # [(]param: | [(]...param:
@@ -84,7 +84,7 @@ variables:
8484
# arrow function possible to detect only with => on same line
8585
(
8686
{{typeParameters}}? # typeparameters
87-
\(\s*(([_$[:alpha:]]|{{matchingBraces}}|{{matchingBrackets}}|(\.\.\.\s*[_$[:alpha:]]))([^()]|{{matchingParenthesis}})*)?\) # parameters
87+
\(\s*({{inlineComment}}\s*)*(([_$[:alpha:]]|{{matchingBraces}}|{{matchingBrackets}}|(\.\.\.\s*[_$[:alpha:]]))([^()]|{{matchingParenthesis}})*)?\) # parameters
8888
(\s*:{{returnTypeOfArrow}})? # return type
8989
\s*=> # arrow operator
9090
)

0 commit comments

Comments
 (0)