KT-13298 Suggest names for overridden properties / functions in completion

#KT-13298 Fixed
This commit is contained in:
Valentin Kipyatkov
2016-08-15 19:17:33 +03:00
parent 7ebf001d25
commit 7f07890f6a
20 changed files with 319 additions and 33 deletions
@@ -0,0 +1,27 @@
interface I {
fun foo()
val someVal: Int
var someVar: Int
}
class Base1 {
protected open fun bar(){}
}
open class Base2 : Base1() {
}
class A : Base2(), I {
fun x() {
unresolved1(unresolved2)
}
override fun <caret>
}
// EXIST: { itemText: "override fun bar() {...}", lookupString: "bar", tailText: null, typeText: "Base1", attributes: "" }
// EXIST: { itemText: "override fun foo() {...}", lookupString: "foo", tailText: null, typeText: "I", attributes: "bold" }
// EXIST: { itemText: "override operator fun equals(other: Any?): Boolean {...}", lookupString: "equals", tailText: null, typeText: "Any", attributes: "" }
// EXIST: { itemText: "override fun hashCode(): Int {...}", lookupString: "hashCode", tailText: null, typeText: "Any", attributes: "" }
// EXIST: { itemText: "override fun toString(): String {...}", lookupString: "toString", tailText: null, typeText: "Any", attributes: "" }
// NOTHING_ELSE
@@ -0,0 +1,23 @@
interface I {
fun foo()
val someVal: Int
var someVar: Int
}
class Base1 {
protected open fun bar(){}
}
open class Base2 : Base1() {
}
class A : Base2(), I {
fun x() {
unresolved1(unresolved2)
}
override val <caret>
}
// EXIST: { itemText: "override val someVal: Int", lookupString: "someVal", tailText: null, typeText: "I", attributes: "bold" }
// NOTHING_ELSE
@@ -0,0 +1,19 @@
interface I {
fun foo()
val someVal: Int
var someVar: Int
}
class Base1 {
protected open fun bar(){}
open val fromBase: String = ""
}
open class Base2 : Base1() {
}
class A(override val <caret>) : Base2(), I
// EXIST: { itemText: "override val someVal: Int", tailText: null, typeText: "I", attributes: "bold" }
// EXIST: { itemText: "override val fromBase: String", tailText: null, typeText: "Base1", attributes: "" }
// NOTHING_ELSE
@@ -0,0 +1,24 @@
interface I {
fun foo()
val someVal: Int
var someVar: Int
}
class Base1 {
protected open fun bar(){}
}
open class Base2 : Base1() {
}
class A : Base2(), I {
fun x() {
unresolved1(unresolved2)
}
override var <caret>
}
// EXIST: { itemText: "override val someVal: Int", lookupString: "someVal", tailText: null, typeText: "I", attributes: "bold" }
// EXIST: { itemText: "override var someVar: Int", lookupString: "someVar", tailText: null, typeText: "I", attributes: "bold" }
// NOTHING_ELSE
@@ -0,0 +1,10 @@
interface I {
fun ov_foo()
}
class A : I {
override fun ov<caret>
}
// ABSENT: override
// EXIST: { itemText: "override fun ov_foo() {...}", allLookupStrings: "ov_foo", tailText: null, typeText: "I", attributes: "bold" }
@@ -16,9 +16,9 @@ class A : Base2(), I {
}
// EXIST: { lookupString: "override", itemText: "override" }
// EXIST: { itemText: "override fun bar() {...}", lookupString: "override", tailText: null, typeText: "Base1", attributes: "" }
// EXIST: { itemText: "override operator fun equals(other: Any?): Boolean {...}", lookupString: "override", tailText: null, typeText: "Any", attributes: "" }
// EXIST: { itemText: "override fun foo() {...}", lookupString: "override", tailText: null, typeText: "I", attributes: "bold" }
// EXIST: { itemText: "override fun hashCode(): Int {...}", lookupString: "override", tailText: null, typeText: "Any", attributes: "" }
// EXIST: { itemText: "override val someVal: Int", lookupString: "override", tailText: null, typeText: "I", attributes: "bold" }
// EXIST: { itemText: "override var someVar: Int", lookupString: "override", tailText: null, typeText: "I", attributes: "bold" }
// EXIST: { itemText: "override fun bar() {...}", lookupString: "override", allLookupStrings: "bar, override", tailText: null, typeText: "Base1", attributes: "" }
// EXIST: { itemText: "override operator fun equals(other: Any?): Boolean {...}", lookupString: "override", allLookupStrings: "equals, override", tailText: null, typeText: "Any", attributes: "" }
// EXIST: { itemText: "override fun foo() {...}", lookupString: "override", allLookupStrings: "foo, override", tailText: null, typeText: "I", attributes: "bold" }
// EXIST: { itemText: "override fun hashCode(): Int {...}", lookupString: "override", allLookupStrings: "hashCode, override", tailText: null, typeText: "Any", attributes: "" }
// EXIST: { itemText: "override val someVal: Int", lookupString: "override", allLookupStrings: "override, someVal", tailText: null, typeText: "I", attributes: "bold" }
// EXIST: { itemText: "override var someVar: Int", lookupString: "override", allLookupStrings: "override, someVar", tailText: null, typeText: "I", attributes: "bold" }