Formatting problem: closures

Hi all,

Using "Reformat Code" really seems to mess up multi-line closures. e.g.

<![CDATA[
object TestFormat {
  def main(args: Array[String]) {
    val list = List("1", "2", "3")
    list.foreach { item =>
      print("Item is: ")
      println(item)
    }
  }
}
]]>

becomes:

<![CDATA[
object TestFormat {
  def main(args: Array[String]) {
    val list = List("1", "2", "3")
    list.foreach{
      item =>
              print("Item is: ")
              println(item)
    }
  }
}
]]>

Is there any way or making formatting leave the example formatted as it was originally? I tried looking at the formatting options but they appear to be for Java not Scala.

Cheers,
Andrew

P.S. Yes, I know the above could be written as a simple for loop

1 comment
Comment actions Permalink

Andrew,

Yes, we realize that it would be better to have separate pages with formatting and color setting for Scala, but now they are not top-priority task. We'll look at your issue specifically. It seems, that variant with small indent looks better. :)

Ilya

0

Please sign in to leave a comment.