Organize imports whitespace conflicts with format-source action
The organize-imports and the format-source actions both modify the whitespace between braces in an import line.
The problem is that they do it differently and there doesn't seem to be a preference to control it.
This is problematic because it generates fake changes in source control depending on which action the dev ran last.
Example:
The problem is that they do it differently and there doesn't seem to be a preference to control it.
This is problematic because it generates fake changes in source control depending on which action the dev ran last.
Example:
- start with this
import org.scalatest.{FreeSpec, FunSpec}
- ctrl-shft-f : format
import org.scalatest.{ FreeSpec, FunSpec }
- ctrl-shft-o : organize imports
import org.scalatest.{FreeSpec, FunSpec}
Leave a comment
on 2013-12-11 12:41 *
By Simon Schäfer
Version changed from 3.0.0-210 to 3.0.2-210
Status changed from New to Accepted
on 2015-09-03 01:53 *
By Iulian Dragos
Unfortunately Scalariform hard-codes the space, so we need to fix that in Scalariform, and add another preference setting (organize imports already has it, see related ticket)
on 2015-09-03 01:53 *
By Iulian Dragos
BTW, this is something I get annoyed by every day, I'd love to get a fix.
on 2016-02-23 05:53 *
By Simon Schäfer
I can't reproduce this anymore. @mlangc Can you remember that you changed the behavior regarding when a space is printed in block imports?
Allow users to specify the spacing around block imports
A new preference option is added to the Scala > Editor preference page,
which allows users to configure if they want to see spaces around a
block import. The default configuration is that the spaces are added,
because this is the behavior of scalariform (whose behavior is hardcoded
and can't be changed).
Fix #1001692
Branch: master
Commit: scala-ide:63efed278b
A new preference option is added to the Scala > Editor preference page,
which allows users to configure if they want to see spaces around a
block import. The default configuration is that the spaces are added,
because this is the behavior of scalariform (whose behavior is hardcoded
and can't be changed).
Fix #1001692
Branch: master
Commit: scala-ide:63efed278b