Search code examples
scalascala-ide

Is it a Scala coding standard to have indentations after val?


I'm using Eclipse with Scala plugin and every time I do something like

val blah = "test"

And press Enter the IDE automatically indents the following line. I'm wondering if this is a coding convention or some weird IDE quirk.


Solution

  • It's definitely just a small bug in Scala-IDE. The plugin has a lot of little formatting issues.

    However, if you want your life to be awesome then you can hit CTRL+SHIFT+F (CMD+SHIFT+F on mac) and it will automatically format your code and correct those little issues.

    EDIT: By the way, it seems there are a couple of tickets out for this issue. See this and this. I added a comment about this precise issue to one of them, so hopefully it's in the queue to get fixed.