Organize import adds incorrect import definitions
Organize import adds incorrect import definitions that cannot be compiled. In my case this command adds import definitions like this:
How to reproduce:
import com.params.ParamsTest.<local ParamsTest>.request
import com.params.ParamsTest.<local ParamsTest>.response
How to reproduce:
- git clone https://github.com/xitrum-framework/xitrum.git
- cd xitrum
- sbt generateVersion eclipse
- Open project in scala-ide
- Open file src/test/scala/xitrum/params/ParamsTest.scala
- Run "Organize imports"
Leave a comment
on 2015-07-16 01:52 *
By caiiiycuk294805
Description changed from Organize import adds incorr... to Organize import adds incorr...
At first let me note, that unfortunately, "Organize Imports" is known to have quite a few issues :-/. People who want to help out with are always welcome! That being said, I could reduce
src/test/scala/xitrum/params/ParamsTest.scala
topackage xitrum.params
import org.scalatest._
import com.m3.curly.scala._
class ParamsTest extends FlatSpec {
"foo" should "not bar" in {
val response: Response = ???
response
}
}
and still reproduce the misbehavior you described above. I'll see what I can do to fix this.
Well, I now have a simple example to reproduce this without any external dependencies: Organizing imports on
package com.github.mlangc.experiments
import com.github.mlangc.experiments.test._
package test {
class Test
}
class Bug {
None.getOrElse {
val x: Test = ???
x
}
}
results inpackage com.github.mlangc.experiments
import com.github.mlangc.experiments.test.Test
import com.mlangc.experiments.Bug.<local Bug>.x
package test {
class Test
}
class Bug {
None.getOrElse {
val x: Test = ???
x
}
}
This is fixed by https://github.com/scala-ide/scala-refactoring/pull/88
The fix was merged and will be part of the next IDE release.