Move: Prevent running refactoring helpers on partial move

It may lead to some imports being wringly removed
due to their references being unresolved yet

Also fix NPE on package rename via directory move
This commit is contained in:
Alexey Sedunov
2017-04-13 15:31:40 +03:00
parent aa0f0ef02d
commit b229eeeb47
14 changed files with 97 additions and 19 deletions
@@ -0,0 +1,14 @@
package c
import a.b.*
import x.y.Foo
import x.y.bar
import x.y.foo
fun Foo.test() {
foo {
bar {
}
}
}
@@ -0,0 +1,7 @@
package x.y
class Bar
fun Bar.bar(block: () -> Unit) {
}
@@ -0,0 +1,7 @@
package x.y
class Foo
fun Foo.foo(block: Bar.() -> Unit) {
Bar().block()
}
@@ -0,0 +1,7 @@
package a./*rename*/b
class Bar
fun Bar.bar(block: () -> Unit) {
}
@@ -0,0 +1,7 @@
package a.b
class Foo
fun Foo.foo(block: Bar.() -> Unit) {
Bar().block()
}
@@ -0,0 +1,11 @@
package c
import a.b.*
fun Foo.test() {
foo {
bar {
}
}
}
@@ -0,0 +1,7 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "a/b/bar.kt",
"newName": "x.y",
"withRuntime": "true",
"byRef": "true"
}