Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrap multiple values in switch expression case
Closes #540 * Wrap multiple values covered in a switch expression case if they exceed the max line length. ```diff switch (e) { - case SOME_RATHER_LONG_NAME_1, SOME_RATHER_LONG_NAME_2, SOME_RATHER_LONG_NAME_3 -> {} + case SOME_RATHER_LONG_NAME_1, + SOME_RATHER_LONG_NAME_2, + SOME_RATHER_LONG_NAME_3 -> {} } ``` * Also collapse empty case blocks in switch expressions. ```diff switch (e) { - case CASE_A -> { - } + case CASE_A -> {} } ``` Fixes #558 COPYBARA_INTEGRATE_REVIEW=#558 from fawind:fw/wrap-case-arguments ff60675 PiperOrigin-RevId: 369513714
- Loading branch information
Showing
4 changed files
with
50 additions
and
6 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
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