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?

0

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

请先登录再写评论。