Move: Support quoted package names

#KT-12411 Fixed
(cherry picked from commit 95239e5)
This commit is contained in:
Alexey Sedunov
2016-06-21 20:57:11 +03:00
parent 89816c5f12
commit 542f8d9fd2
48 changed files with 290 additions and 28 deletions
@@ -0,0 +1,5 @@
{
"mainFile": "in/foo/fun/test.kt",
"intentionClass": "org.jetbrains.kotlin.idea.refactoring.move.changePackage.ChangePackageToMatchDirectoryIntention",
"intentionText": "Change file's package to 'in.foo.fun'"
}
@@ -0,0 +1,7 @@
package `in`.foo.`fun`
class Foo
fun foo() {
}
@@ -0,0 +1,8 @@
package in.foo.fun;
class Test {
static void test() {
new Foo();
TestKt.foo();
}
}
@@ -0,0 +1,6 @@
package `in`.foo.`fun`
fun test() {
Foo()
foo()
}
@@ -0,0 +1,10 @@
package in.foo.fun;
import static in.foo.fun.TestKt.foo;
class Test {
static void test() {
new Foo();
foo();
}
}
@@ -0,0 +1,9 @@
package `in`.foo.`fun`
import `in`.foo.`fun`.Foo
import `in`.foo.`fun`.foo
fun test() {
Foo()
foo()
}
@@ -0,0 +1,11 @@
package usages;
import in.foo.fun.Foo;
import in.foo.fun.TestKt;
class Test {
static void test() {
new Foo();
TestKt.foo();
}
}
@@ -0,0 +1,9 @@
package usages
import `in`.foo.`fun`.Foo
import `in`.foo.`fun`.foo
fun test() {
Foo()
foo()
}
@@ -0,0 +1,11 @@
package usages;
import in.foo.fun.Foo;
import static in.foo.fun.TestKt.foo;
class Test {
static void test() {
new Foo();
foo();
}
}
@@ -0,0 +1,9 @@
package usages
import `in`.foo.`fun`.Foo
import `in`.foo.`fun`.foo
fun test() {
Foo()
foo()
}
@@ -0,0 +1,7 @@
<caret>package bar
class Foo
fun foo() {
}
@@ -0,0 +1,8 @@
package in.foo.fun;
class Test {
static void test() {
new bar.Foo();
bar.TestKt.foo();
}
}
@@ -0,0 +1,6 @@
package `in`.foo.`fun`
fun test() {
bar.Foo()
bar.foo()
}
@@ -0,0 +1,11 @@
package in.foo.fun;
import bar.Foo;
import static bar.TestKt.foo;
class Test {
static void test() {
new Foo();
foo();
}
}
@@ -0,0 +1,9 @@
package `in`.foo.`fun`
import bar.Foo
import bar.foo
fun test() {
Foo()
foo()
}
@@ -0,0 +1,8 @@
package usages;
class Test {
static void test() {
new bar.Foo();
bar.TestKt.foo();
}
}
@@ -0,0 +1,6 @@
package usages
fun test() {
bar.Foo()
bar.foo()
}
@@ -0,0 +1,11 @@
package usages;
import bar.Foo;
import static bar.TestKt.foo;
class Test {
static void test() {
new Foo();
foo();
}
}
@@ -0,0 +1,9 @@
package usages
import bar.Foo
import bar.foo
fun test() {
Foo()
foo()
}
@@ -0,0 +1,9 @@
package `in`.p1
import `in`.p2.p.J
import `in`.p2.p.K
public class M {
val j = J()
val k = K()
}
@@ -0,0 +1,9 @@
package in.p2;
import in.p2.p.K;
import in.p1.M;
public class JJ {
K k = new K();
M m = new M();
}
@@ -0,0 +1,9 @@
package `in`.p2
import `in`.p1.M
import `in`.p2.p.K
public class L {
private val k = K()
private val m = M()
}
@@ -0,0 +1,5 @@
package in.p2.p;
public class J {
K k = new K();
}
@@ -0,0 +1,5 @@
package `in`.p2.p
public class K {
val j = J()
}
@@ -0,0 +1,9 @@
package `in`.p1
import `in`.p1.p.J
import `in`.p1.p.K
public class M {
val j = J()
val k = K()
}
@@ -0,0 +1,5 @@
package in.p1.p;
public class J {
K k = new K();
}
@@ -0,0 +1,5 @@
package `in`.p1.p
public class K {
val j = J()
}
@@ -0,0 +1,9 @@
package in.p2;
import in.p1.p.K;
import in.p1.M;
public class JJ {
K k = new K();
M m = new M();
}
@@ -0,0 +1,9 @@
package `in`.p2
import `in`.p1.M
import `in`.p1.p.K
public class L {
private val k = K()
private val m = M()
}
@@ -0,0 +1,6 @@
{
"mainFile": "in/p1/M.kt",
"type": "MOVE_DIRECTORY_WITH_CLASSES",
"sourceDir": "in/p1/p",
"targetDir": "in/p2"
}
@@ -1,5 +0,0 @@
package p
fun foo() {
}
@@ -0,0 +1,5 @@
package p.`123`
fun foo() {
}