Shorten references inserts imports for global functions and properties too

This commit is contained in:
Valentin Kipyatkov
2015-02-13 00:09:04 +03:00
parent 664e2781e8
commit 20cf100714
34 changed files with 105 additions and 61 deletions
@@ -1,7 +1,7 @@
package to
import a.with
import a.Outer
import a.with
fun f(p1: Outer.Nested.NN, p2: Outer.Nested.NI, p3: Outer.Inner.II) {
Outer.Nested.NN2()
@@ -1,11 +1,11 @@
package to
import d.g
import d.c
import d.ext
import d.A
import d.T
import d.Outer
import d.c
import d.g
import d.O1
import d.O2
import d.E
@@ -1,11 +1,11 @@
package to
import d.g
import d.c
import d.ext
import d.A
import d.T
import d.Outer
import d.c
import d.g
import d.O1
import d.O2
import d.E
@@ -1,7 +1,7 @@
package to
import a.f
import a.ext
import a.f
fun g() {
f {
@@ -1,5 +1,6 @@
package source
import target.A
import target.test
fun test1() = target.test(A())
fun test1() = test(A())
@@ -1,10 +1,12 @@
package c
import b.Test
import b.test
import b.TEST
fun bar() {
val t: Test = Test()
b.test()
println(b.TEST)
b.TEST = ""
test()
println(TEST)
TEST = ""
}
@@ -1,5 +1,7 @@
package a
import b.test
fun bar() {
b.test()
test()
}
@@ -1,7 +1,9 @@
package a
import b.test
class Test {
fun foo() {
b.test()
test()
}
}
@@ -1,5 +1,7 @@
package a
import b.test
fun bar() {
b.test()
test()
}
@@ -1,5 +1,7 @@
package c
import b.test
fun bar() {
b.test()
test()
}
@@ -1,7 +1,8 @@
package c
import a.*
import b.test
fun bar() {
b.test()
test()
}
@@ -1,5 +1,7 @@
package a
import b.test
fun bar() {
b.test()
test()
}
@@ -1,7 +1,9 @@
package a
import b.test
class Test {
fun foo() {
b.test()
test()
}
}
@@ -1,5 +1,7 @@
package a
import b.test
fun bar() {
b.test()
test()
}
@@ -1,5 +1,7 @@
package c
import b.test
fun bar() {
b.test()
test()
}
@@ -1,7 +1,8 @@
package c
import a.*
import b.test
fun bar() {
b.test()
test()
}
@@ -1,6 +1,8 @@
package a
import b.test
fun bar() {
b.test = ""
println(b.test)
test = ""
println(test)
}
@@ -1,7 +1,9 @@
package a
import b.test
class Test {
fun foo() {
b.test()
test()
}
}
@@ -1,6 +1,8 @@
package a
import b.test
fun bar() {
b.test = ""
println(b.test)
test = ""
println(test)
}
@@ -1,6 +1,8 @@
package c
import b.test
fun bar() {
b.test = ""
println(b.test)
test = ""
println(test)
}
@@ -1,8 +1,9 @@
package c
import a.*
import b.test
fun bar() {
b.test = ""
println(b.test)
test = ""
println(test)
}
@@ -1,6 +1,8 @@
package a
import b.test
fun bar() {
b.test = ""
println(b.test)
test = ""
println(test)
}
@@ -1,7 +1,9 @@
package a
import b.test
class Test {
fun foo() {
b.test()
test()
}
}
@@ -1,6 +1,8 @@
package a
import b.test
fun bar() {
b.test = ""
println(b.test)
test = ""
println(test)
}
@@ -1,6 +1,8 @@
package c
import b.test
fun bar() {
b.test = ""
println(b.test)
test = ""
println(test)
}
@@ -1,8 +1,9 @@
package c
import a.*
import b.test
fun bar() {
b.test = ""
println(b.test)
test = ""
println(test)
}
@@ -0,0 +1,4 @@
package p
fun globalFun(p: Int) {}
val globalVal: Int = 1
@@ -0,0 +1,3 @@
fun foo() {
<selection>p.globalFun(p.globalVal)</selection>
}
@@ -0,0 +1,6 @@
import p.globalVal
import p.globalFun
fun foo() {
globalFun(globalVal)
}