Skip to content

Commit

Permalink
Handle function expressions to consume line ending of single line com…
Browse files Browse the repository at this point in the history
…ment since we rely on lookback of function completion (})

Fixes #455 after making change in comments to not consume line endings
  • Loading branch information
sheetalkamat committed Aug 21, 2018
1 parent 486f645 commit ebb42d0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions TypeScript.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -655,6 +655,7 @@ repository:
end: (?<=\})
patterns:
- include: '#function-name'
- include: '#single-line-comment-consuming-line-ending'
- include: '#function-body'

function-name:
Expand Down
4 changes: 4 additions & 0 deletions TypeScript.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -2078,6 +2078,10 @@
<key>include</key>
<string>#function-name</string>
</dict>
<dict>
<key>include</key>
<string>#single-line-comment-consuming-line-ending</string>
</dict>
<dict>
<key>include</key>
<string>#function-body</string>
Expand Down
4 changes: 4 additions & 0 deletions TypeScriptReact.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -2082,6 +2082,10 @@
<key>include</key>
<string>#function-name</string>
</dict>
<dict>
<key>include</key>
<string>#single-line-comment-consuming-line-ending</string>
</dict>
<dict>
<key>include</key>
<string>#function-body</string>
Expand Down

0 comments on commit ebb42d0

Please sign in to comment.