Skip to content

Commit

Permalink
Handle inline comment inside arrow parenthesis
Browse files Browse the repository at this point in the history
Fixes #686
  • Loading branch information
sheetalkamat committed Nov 20, 2018
1 parent c6c261f commit 72cb5cd
Show file tree
Hide file tree
Showing 5 changed files with 130 additions and 46 deletions.
4 changes: 2 additions & 2 deletions TypeScript.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ variables:
# sure shot arrow functions even if => is on new line
(
{{typeParameters}}?
[(]\s*
[(]\s*({{inlineComment}}\s*)*
(
([)]\s*:) | # ():
((\.\.\.\s*)?{{identifier}}\s*:) # [(]param: | [(]...param:
Expand All @@ -84,7 +84,7 @@ variables:
# arrow function possible to detect only with => on same line
(
{{typeParameters}}? # typeparameters
\(\s*(([_$[:alpha:]]|{{matchingBraces}}|{{matchingBrackets}}|(\.\.\.\s*[_$[:alpha:]]))([^()]|{{matchingParenthesis}})*)?\) # parameters
\(\s*({{inlineComment}}\s*)*(([_$[:alpha:]]|{{matchingBraces}}|{{matchingBrackets}}|(\.\.\.\s*[_$[:alpha:]]))([^()]|{{matchingParenthesis}})*)?\) # parameters
(\s*:{{returnTypeOfArrow}})? # return type
\s*=> # arrow operator
)
Expand Down
Loading

0 comments on commit 72cb5cd

Please # to comment.