[Analysis API] Shorten qualifier of unresolved reference

^KTIJ-25115
This commit is contained in:
aleksandrina-streltsova
2023-04-27 18:55:00 +03:00
committed by teamcity
parent 2d945b7226
commit ed7a3299f0
11 changed files with 121 additions and 6 deletions
@@ -0,0 +1,5 @@
package some
annotation class SomeAnnotation
class Complete(@set:<expr>some.SomeAnnotation</expr> var field: Int)
@@ -0,0 +1,8 @@
Before shortening: some.SomeAnnotation
with DO_NOT_SHORTEN:
with SHORTEN_IF_ALREADY_IMPORTED:
[type] some.SomeAnnotation
with SHORTEN_AND_IMPORT:
[type] some.SomeAnnotation
with SHORTEN_AND_STAR_IMPORT:
[type] some.SomeAnnotation
@@ -0,0 +1,3 @@
// WITH_STDLIB
// FILE: main.kt
fun other() : <expr>java.util.SortedSet</expr>
@@ -0,0 +1,7 @@
Before shortening: java.util.SortedSet
with DO_NOT_SHORTEN:
with SHORTEN_IF_ALREADY_IMPORTED:
with SHORTEN_AND_IMPORT:
[type] java.util.SortedSet
with SHORTEN_AND_STAR_IMPORT:
[type] java.util.SortedSet
@@ -0,0 +1,8 @@
// FILE: main.kt
package x.y.z
fun test(a: <expr>a.b.c.A.f</expr>) {}
// FILE: dependency.kt
package a.b.c
class A
@@ -0,0 +1,7 @@
Before shortening: a.b.c.A.f
with DO_NOT_SHORTEN:
with SHORTEN_IF_ALREADY_IMPORTED:
with SHORTEN_AND_IMPORT:
[type] a.b.c.A
with SHORTEN_AND_STAR_IMPORT:
[type] a.b.c.A
@@ -0,0 +1,14 @@
package foo.bar
interface A {
fun foo(i: Int) {}
}
interface B {
fun foo(i2: Int) {}
}
class C : A, B {
override fun foo(j: Int) {
super<<expr>foo.bar.A</expr>>.foo()
}
}
@@ -0,0 +1,8 @@
Before shortening: foo.bar.A
with DO_NOT_SHORTEN:
with SHORTEN_IF_ALREADY_IMPORTED:
[type] foo.bar.A
with SHORTEN_AND_IMPORT:
[type] foo.bar.A
with SHORTEN_AND_STAR_IMPORT:
[type] foo.bar.A