I have a class named FooBar and use the import "import com.test.FooBar". When I click on the class name with my right mouse key in my editor window and rename it to FoosBar, the problem appears. My Import now is "import com.test FoosBar", so the dot before the class name is missing, in every class this import is used. If my project has 400 classes, this could be very annoying.
Leave a comment
on 2015-08-30 09:11 *
By Simon Schäfer
Sadly, I can't reproduce this issue. Did this happen only for FooBar or also for other classes? Can you show the content of FooBar? Maybe there is something in there our refactoring tools do not like.
Hi Simon,
I tried to reproduce this Bug with this minimal example class structure:
com.test.foo.Foo.scala
com.test.bar.Bar.scala
com.test.Test.scala
In Test.scala there was a Test class and a Test object. In this Test object I had a case class that is used in Bar or/and Foo, so Import this case class to Foo or/and Bar and then rename the Test class with your context menu. Afterwards your case class imports are broken.
I tried to reproduce this Bug with this minimal example class structure:
com.test.foo.Foo.scala
com.test.bar.Bar.scala
com.test.Test.scala
In Test.scala there was a Test class and a Test object. In this Test object I had a case class that is used in Bar or/and Foo, so Import this case class to Foo or/and Bar and then rename the Test class with your context menu. Afterwards your case class imports are broken.
Ok, I can reproduce it now.
on 2015-08-31 17:11 *
By Simon Schäfer
Code example:
After renaming Test1 to Test2, the import in file2 is broken:
// file 1
package com.test
object Test1 {
class Class
}
// file 2
package com.test.bar
import com.test.Test1.Class
class Bar {
def x: Class = ???
}
After renaming Test1 to Test2, the import in file2 is broken:
package com.test.bar
import com.test Test2.Class
class Bar {
def x: Class = ???
}
No file chosen
You have an empty file field. Please select or remove it.
Name | Size |
---|