Add a KotlinLang formatter for when expressions - #687
Open
AbdullinAM wants to merge 7 commits into
Open
Conversation
AbdullinAM
force-pushed
the
abdullin/when-conditions
branch
2 times, most recently
from
August 31, 2026 15:43
d6c240b to
5606559
Compare
AbdullinAM
force-pushed
the
abdullin/rewrite-to-contexts
branch
3 times, most recently
from
September 2, 2026 08:29
03f232d to
6a69f86
Compare
AbdullinAM
force-pushed
the
abdullin/when-conditions
branch
from
September 2, 2026 09:33
5606559 to
24107ee
Compare
Collaborator
|
What do you think about breaking before if, instead of breaking after if in when guard? |
kunyavskiy
reviewed
Sep 4, 2026
AbdullinAM
force-pushed
the
abdullin/when-conditions
branch
5 times, most recently
from
September 4, 2026 12:35
6dcd9f7 to
3e519c6
Compare
* Don't force break after comma in multiple-condition entries * Don't allow break before `->` in any cases
…comma in when entry conditions list
…th a trailing comma
… line comments #692 Fixed
AbdullinAM
force-pushed
the
abdullin/when-conditions
branch
from
September 4, 2026 14:53
3e519c6 to
7b1d636
Compare
kunyavskiy
reviewed
Sep 7, 2026
| } else { | ||
| val conditions = whenEntry.conditions | ||
| val lastIndex = conditions.lastIndex | ||
| val lastCommaIndex = if (forceMultiline) lastIndex + 1 else lastIndex |
Collaborator
There was a problem hiding this comment.
Minor: probably checking on trailing lambda explicitly is better, in case we would have other reasons to make multiline later.
kunyavskiy
approved these changes
Sep 7, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
->in any cases