KTIJ-28080 [AA] Move selection checking to ElementsToShortenCollector.findClassifierQualifierToShorten
This way, even if the whole qualifier is not selected, but some of its parts are, the reference shortener will correctly find and shorten those parts ^KTIJ-28080 Fixed
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
// FILE: main.kt
|
||||
package test
|
||||
|
||||
fun usage(
|
||||
foo: _root_ide_package_.dependency.Foo
|
||||
) {
|
||||
<expr>"random expr"</expr>
|
||||
|
||||
_root_ide_package_.dependency.Foo.bar()
|
||||
}
|
||||
|
||||
// FILE: dependency.kt
|
||||
package dependency
|
||||
|
||||
object Foo {
|
||||
fun bar() {}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
Before shortening: "random expr"
|
||||
with default settings:
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
// FILE: main.kt
|
||||
package test
|
||||
|
||||
fun usage(foo: <expr>dependency.Foo</expr>.Bar) {}
|
||||
|
||||
// FILE: dependency.kt
|
||||
package dependency
|
||||
|
||||
class Foo {
|
||||
class Bar
|
||||
}
|
||||
analysis/analysis-api/testData/components/referenceShortener/shortenRange/partiallySelectedType3.txt
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
Before shortening: dependency.Foo
|
||||
with default settings:
|
||||
[type] dependency.Foo
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] dependency.Foo
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] dependency.Foo
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// FILE: main.kt
|
||||
package test
|
||||
|
||||
import dependency.Foo
|
||||
|
||||
fun usage(foo: <expr>dependency.Foo.Bar</expr>.Baz) {}
|
||||
|
||||
// FILE: dependency.kt
|
||||
package dependency
|
||||
|
||||
class Foo {
|
||||
class Bar {
|
||||
class Baz
|
||||
}
|
||||
}
|
||||
analysis/analysis-api/testData/components/referenceShortener/shortenRange/partiallySelectedType4.txt
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
Before shortening: dependency.Foo.Bar
|
||||
with default settings:
|
||||
[type] dependency.Foo
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[type] dependency.Foo
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[type] dependency.Foo.Bar
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[type] dependency.Foo.Bar
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// FILE: main.kt
|
||||
package test
|
||||
|
||||
fun usage() {
|
||||
<expr>dependency.Foo</expr>.Bar.baz()
|
||||
}
|
||||
|
||||
// FILE: dependency.kt
|
||||
package dependency
|
||||
|
||||
object Foo {
|
||||
object Bar {
|
||||
fun baz() {}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
Before shortening: dependency.Foo
|
||||
with default settings:
|
||||
[qualifier] dependency.Foo
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] dependency.Foo
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] dependency.Foo
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// FILE: main.kt
|
||||
package test
|
||||
|
||||
import dependency.Foo
|
||||
|
||||
fun usage() {
|
||||
<expr>dependency.Foo.Bar</expr>.Baz.qux()
|
||||
}
|
||||
|
||||
// FILE: dependency.kt
|
||||
package dependency
|
||||
|
||||
object Foo {
|
||||
class Bar {
|
||||
object Baz {
|
||||
fun qux() {}
|
||||
}
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
Before shortening: dependency.Foo.Bar
|
||||
with default settings:
|
||||
[qualifier] dependency.Foo
|
||||
with DO_NOT_SHORTEN:
|
||||
with SHORTEN_IF_ALREADY_IMPORTED:
|
||||
[qualifier] dependency.Foo
|
||||
with SHORTEN_AND_IMPORT:
|
||||
[qualifier] dependency.Foo.Bar
|
||||
with SHORTEN_AND_STAR_IMPORT:
|
||||
[qualifier] dependency.Foo.Bar
|
||||
Reference in New Issue
Block a user