intellij-community icon indicating copy to clipboard operation
intellij-community copied to clipboard

KTIJ-103: Trailing comma breaks formatting of 'when' expression

Open osipxd opened this issue 3 years ago • 7 comments

Issue on YouTrack: KTIJ-103

osipxd avatar Sep 13 '22 20:09 osipxd

Also I don't quite sure how the code should be formatted in the case when we have line break after arrow. Like this?

when(x) {
    1
        ->
        {
            println(1)
        }
}

UPD: Found that line break between -> and { will be removed after reformat

osipxd avatar Sep 13 '22 20:09 osipxd

@osipxd Hi! Are you going to continue work on this PR? I'd like to fix this issue

IlyaGulya avatar Sep 15 '23 11:09 IlyaGulya

@IlyaGulya, sure, feel free to work on it! I've rebased the branch onto the fresh master and fixed review comments. If you want to continue work in this branch, let me know and I'll give you access to the fork.

osipxd avatar Sep 17 '23 23:09 osipxd

@dimonchik0036 Hi! I've just pushed fixes for this issue. Also, I've added separate test WhenEntryArrow which checks that formatter correctly behaves on caret moving to next line by Enter action. Please take a look and tell if everything is ok.

IlyaGulya avatar Oct 24 '23 16:10 IlyaGulya

@dimonchik0036 Hi! Please, take a look on this PR, or, at least, ping someone who is responsible for it now.

IlyaGulya avatar Jan 25 '24 04:01 IlyaGulya

@vladimirdolzhenko Hi! Can you please also take a look on this PR? 🙂

IlyaGulya avatar Jan 27 '24 17:01 IlyaGulya

@dimonchik0036 @vladimirdolzhenko Gentle reminder about this PR 🙂 I've rebased on latest master

IlyaGulya avatar Apr 23 '24 14:04 IlyaGulya

@aleksandrina-streltsova thanks!

IlyaGulya avatar May 02 '24 14:05 IlyaGulya