FIR IDE: Add fine-grained control to KtReferenceShortener

This change makes it possible to control how references to a symbol should be shortened.
This commit is contained in:
Tianyu Geng
2021-05-27 15:25:45 -07:00
committed by TeamCityServer
parent 8ac2a48eaf
commit 726d141589
10 changed files with 346 additions and 163 deletions
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
open class Base<A, B, C>() {
open val method : (A?) -> A = { it!! }
open fun foo(value : B) : B = value
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
open class Base<A, B, C>() {
open val method : (A?) -> A = { it!! }
open fun foo(value : B) : B = value
@@ -1,30 +0,0 @@
open class Base<A, B, C>() {
open val method : (A?) -> A = { it!! }
open fun foo(value : B) : B = value
open fun bar(value : () -> C) : (String) -> C = { value() }
}
class C : Base<String, C, Unit>() {
override fun bar(value: () -> Unit): (String) -> Unit {
<selection><caret>return super.bar(value)</selection>
}
override fun equals(other: Any?): Boolean {
return super.equals(other)
}
override fun foo(value: C): C {
return super.foo(value)
}
override fun hashCode(): Int {
return super.hashCode()
}
override val method: (String?) -> String
get() = method
override fun toString(): String {
return super.toString()
}
}
@@ -7,7 +7,7 @@ class C : A() {
val constant = 42
// Some comment
override val bar: Int
get() = <selection><caret>bar</selection>
get() = <selection><caret>super.bar</selection>
override fun equals(other: Any?): Boolean {
return super.equals(other)