-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add line breaks to lambdas after broken function arguments
Summary: We've had some requests to format this: ``` foo.bar( trailingComma, ) { x = 0 } ``` As this: ``` foo.bar( trailingComma, ) { x = 0 } ``` Here I do that by keeping track of when we enter lambda arguments in call elements and noting if there's a trailing comma. ## Caveat **Google-style requires a trailing comma** The Google-style formatting puts the closing paren on the next line, even when there's no trailing comma. Due to this we can't detect that we need to put a break in the lambda. This could be fixed by detecting if the params broke (instead of looking for a trailing comma) but I'm not sure how to do that. Reviewed By: strulovich Differential Revision: D36649191 fbshipit-source-id: 2c8d316f068c1030437af59b5114ffae9d5d2aa8
- Loading branch information
1 parent
bd2e5c7
commit c0e6243
Showing
3 changed files
with
194 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters