[AA] Shortener: allow import if requested import kind has high priority
This commit is contained in:
committed by
teamcity
parent
a96e2f37e7
commit
57cbab7d8e
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_STDLIB
|
||||
// FILE: main.kt
|
||||
|
||||
fun test() = <expr>kotlin.text.charset("")</expr>
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
Before shortening: kotlin.text.charset("")
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[qualifier] kotlin.text.charset("")
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] kotlin.text.charset("")
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] kotlin.text.charset("")
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// WITH_STDLIB
|
||||
// FILE: main.kt
|
||||
import java.nio.charset.Charset
|
||||
|
||||
fun charset(charsetName: String): Charset = Charset.forName(charsetName)
|
||||
|
||||
fun test() = <expr>kotlin.text.charset("")</expr>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
Before shortening: kotlin.text.charset("")
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// FILE: main.kt
|
||||
package a.b.c
|
||||
|
||||
fun foo() {}
|
||||
|
||||
fun test() {
|
||||
<expr>dependency.foo()</expr>
|
||||
}
|
||||
|
||||
// FILE: dependency.kt
|
||||
package dependency
|
||||
|
||||
fun foo() {}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
Before shortening: dependency.foo()
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] dependency.foo()
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
+1
-1
@@ -3,6 +3,6 @@ with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[qualifier] a.b.c.MyClass
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] a.b.c.MyClass.Companion
|
||||
[qualifier] a.b.c.MyClass.Companion.foo()
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] a.b.c.MyClass.Companion
|
||||
|
||||
Reference in New Issue
Block a user