Recent code reviews have turned up lots of spurious whitespace changes in my 
code. I have finally deciphered the issue so am sharing here to save others the 
trouble.


So I use the scalaIDE for most development. This is just a bundle of stuff in 
Eclipse.


I recently discovered that the scala code formatting that this does on save of 
a file is *non-standard*.


ScalaIDE uses the scalariform code formatter, but has different defaults for 
some of the settings than are documented as the defaults by scalariform.


You need to choose the default scala formatting, then uncheck two options on 
the Alignment tab of the formatting dialog.


Align parameters on different lines in the same column

Align the arrows of consecutive single-line case statements


The remainder of the settings, in ScalaIDE anyway, seem to be proper.


Note that "no boxes checked" is NOT the proper default. On the Indentation, 
Spaces, and Miscellaneous tabs of the Formatter dialog box, some options are 
checked if you hit the "Restore Defaults" button.


Reply via email to