Move: Force package name change when moving Java files
Package statement in Java file is updated too late when moving the entire containing directory, so we force it with intercepting MoveFileHandler implementation
This commit is contained in:
+4
@@ -0,0 +1,4 @@
|
||||
package test;
|
||||
|
||||
public class Bar {
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package test.pack
|
||||
|
||||
import test2.pack.A
|
||||
import test2.pack.J
|
||||
|
||||
class Foo {
|
||||
val a = A()
|
||||
val j = J()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package test2
|
||||
|
||||
import test.pack.Foo
|
||||
|
||||
val foo = Foo()
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test2.pack;
|
||||
|
||||
import test.*;
|
||||
import test.pack.Foo;
|
||||
|
||||
public class J {
|
||||
A a = new A();
|
||||
B b = new B();
|
||||
C c = new C();
|
||||
Foo foo = new Foo();
|
||||
Bar bar = new Bar();
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package test2.pack
|
||||
|
||||
import test.Bar
|
||||
import test.pack.Foo
|
||||
|
||||
class A {
|
||||
val b = B()
|
||||
}
|
||||
|
||||
class B {
|
||||
val a = A()
|
||||
}
|
||||
|
||||
class C {
|
||||
internal val foo = Foo()
|
||||
internal val bar = Bar()
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package test;
|
||||
|
||||
public class Bar {
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package test.pack
|
||||
|
||||
class Foo {
|
||||
val a = A()
|
||||
val j = J()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package test
|
||||
|
||||
import test.pack.Foo
|
||||
|
||||
val foo = Foo()
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package test.pack;
|
||||
|
||||
import test.*;
|
||||
|
||||
public class J {
|
||||
A a = new A();
|
||||
B b = new B();
|
||||
C c = new C();
|
||||
Foo foo = new Foo();
|
||||
Bar bar = new Bar();
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package test.pack
|
||||
|
||||
import test.Bar
|
||||
|
||||
class A {
|
||||
val b = B()
|
||||
}
|
||||
|
||||
class B {
|
||||
val a = A()
|
||||
}
|
||||
|
||||
class C {
|
||||
internal val foo = Foo()
|
||||
internal val bar = Bar()
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"filesToMove": ["test/FooUsage.kt", "test/pack"],
|
||||
"type": "MOVE_FILES_WITH_DECLARATIONS",
|
||||
"targetDirectory": "test2"
|
||||
}
|
||||
Reference in New Issue
Block a user