Kotlin: expression body function is folded together with the preceding comment

Answered

For example, there is a function following by a comment:

(Login.kt)

When i press Ctrl+Shift+- (Code | Folding | Collapse All), it collapsed in a way i didn't expect:

And I am pretty sure anyone would not expect a function folding like this. We may prefer: 

It is better, and more reasonable.

0
3 comments

Can't reproduce: http://www.giphy.com/gifs/3SyXR1ZhlsGEOslRVZ

As a general troubleshooting step, please reset settings to default via File | Manage IDE Settings | Restore Default Settings

If it does not help, please share a complete code sample.

0
Avatar
Permanently deleted user

Konstantin Annikov

As I mentioned in the title, the problem comes along with functions which have a expression body

(Sample.kt, before collapsing)

(Sample.kt, after collapsing)

0

Hello! Sorry for the long answer. See,s very similar to https://youtrack.jetbrains.com/issue/KTIJ-525 which is fixed in IDEA 2021.1. Does the problem still reproduce on your side?

0

Please sign in to leave a comment.