Weird formatting of higher order methods in 2016.2

Hi,

One of our users just reported strange formatting after upgrade to 2016.2.

List(1,2,3)
.distinct
.map {
case foo => foo + 1
}
.filter {
_ => true
}

works fine, but when you put 'distinct' and 'map' into one line it ends up like this:

List(1,2,3)
.distinct.map {
case foo => foo + 1
}
.filter {
_ => true
}

Is this a bug?

1 comment
Comment actions Permalink

Hi Sidus, it seems to be a bug. I've created issue for you: https://youtrack.jetbrains.com/issue/SCL-11104

Also, in this particular example you could apply inspection "Convert to anonymous function"  and get rid of problems with formatting

List(1, 3)
.distinct.map(_ + 1)
.filter {
_ => true
}

(Here I also have applied intention "Introduce Implicit parameter" on "foo")

 

0

Please sign in to leave a comment.