Completion: bold members from immediate class

This commit is contained in:
Valentin Kipyatkov
2014-11-14 23:06:09 +03:00
parent 79cfe2bac4
commit d061c3d771
21 changed files with 251 additions and 24 deletions
@@ -0,0 +1,23 @@
trait T {
fun fromTrait(){}
}
abstract class Base : T {
fun fromBase(){}
}
class Derived : Base() {
override fun fromTrait() { }
fun fromDerived(){}
}
fun foo(d: Derived) {
d.<caret>
}
// EXIST: { itemText: "fromTrait", attributes: "bold" }
// EXIST: { itemText: "fromDerived", attributes: "bold" }
// EXIST: { itemText: "fromBase", attributes: "" }
// EXIST: { itemText: "hashCode", attributes: "" }
// EXIST: { itemText: "equals", attributes: "" }
@@ -0,0 +1,25 @@
trait T {
fun fromTrait(){}
}
abstract class Base : T {
fun fromBase(){}
}
class Derived : Base() {
override fun fromTrait() { }
fun fromDerived(){}
}
fun foo(o: Any) {
if (o is Derived) {
o.<caret>
}
}
// EXIST: { itemText: "fromTrait", attributes: "bold" }
// EXIST: { itemText: "fromDerived", attributes: "bold" }
// EXIST: { itemText: "fromBase", attributes: "" }
// EXIST: { itemText: "hashCode", attributes: "" }
// EXIST: { itemText: "equals", attributes: "" }
@@ -0,0 +1,14 @@
trait T {
fun f(){}
}
fun foo(o: T) {
if (o is Runnable) {
o.<caret>
}
}
// EXIST: { itemText: "run", attributes: "bold" }
// EXIST: { itemText: "f", attributes: "bold" }
// EXIST: { itemText: "hashCode", attributes: "" }
// EXIST: { itemText: "equals", attributes: "" }
@@ -0,0 +1,16 @@
trait T {
fun foo1(){}
fun foo2(){}
}
class B(worker: T) : T by worker {
override fun foo1() { }
}
fun foo(b: B) {
b.<caret>
}
// EXIST: { itemText: "foo1", attributes: "bold" }
// EXIST: { itemText: "foo2", attributes: "" }
// EXIST: { itemText: "equals", attributes: "" }
@@ -0,0 +1,24 @@
trait T {
fun fromTrait(){}
}
abstract class Base : T {
fun fromBase(){}
}
class Derived : Base() {
override fun fromTrait() { }
fun fromDerived(){}
fun foo(d: Derived) {
<caret>
}
}
// EXIST: { itemText: "foo", attributes: "bold" }
// EXIST: { itemText: "fromTrait", attributes: "bold" }
// EXIST: { itemText: "fromDerived", attributes: "bold" }
// EXIST: { itemText: "fromBase", attributes: "" }
// EXIST: { itemText: "hashCode", attributes: "" }
// EXIST: { itemText: "equals", attributes: "" }
@@ -14,10 +14,10 @@ fun foo(){
val k : K = <caret>
}
// EXIST: { lookupString:"foo", itemText:"K.foo", tailText:" (sample)", typeText:"K" }
// EXIST: { lookupString:"bar", itemText:"K.bar", tailText:"() (sample)", typeText:"K" }
// EXIST: { lookupString:"foo", itemText:"K.foo", tailText:" (sample)", typeText:"K", attributes:"" }
// EXIST: { lookupString:"bar", itemText:"K.bar", tailText:"() (sample)", typeText:"K", attributes:"" }
// ABSENT: { itemText: "K.x" }
// ABSENT: { itemText:"K.kk" }
// EXIST: { lookupString:"kk", itemText:"!! K.kk", tailText:" (sample)", typeText:"K?" }
// EXIST: { lookupString:"kk", itemText:"?: K.kk", tailText:" (sample)", typeText:"K?" }
// EXIST: { lookupString:"kk", itemText:"!! K.kk", tailText:" (sample)", typeText:"K?", attributes:"" }
// EXIST: { lookupString:"kk", itemText:"?: K.kk", tailText:" (sample)", typeText:"K?", attributes:"" }
// ABSENT: { itemText: "K.privateVal" }
@@ -0,0 +1,22 @@
trait T {
fun fromTrait() = ""
}
abstract class Base : T {
fun fromBase() = ""
}
class Derived : Base() {
override fun fromTrait() = ""
val fromDerived: String = ""
}
fun foo(d: Derived): String {
return d.<caret>
}
// EXIST: { itemText: "fromTrait", attributes: "bold" }
// EXIST: { itemText: "fromDerived", attributes: "bold" }
// EXIST: { itemText: "fromBase", attributes: "" }
// EXIST: { itemText: "toString", attributes: "" }
@@ -2,5 +2,5 @@ fun foo(){
var l : java.util.Locale = <caret>
}
// EXIST: { lookupString:"ENGLISH", itemText:"Locale.ENGLISH", tailText:" (java.util)", typeText:"Locale!" }
// EXIST: { lookupString:"FRENCH", itemText:"Locale.FRENCH", tailText:" (java.util)", typeText:"Locale!" }
// EXIST: { lookupString:"ENGLISH", itemText:"Locale.ENGLISH", tailText:" (java.util)", typeText:"Locale!", attributes:"" }
// EXIST: { lookupString:"FRENCH", itemText:"Locale.FRENCH", tailText:" (java.util)", typeText:"Locale!", attributes:"" }
@@ -2,6 +2,6 @@ fun foo(){
val l : java.util.Calendar = <caret>
}
// EXIST: { lookupString:"getInstance", itemText:"Calendar.getInstance", tailText:"() (java.util)", typeText:"Calendar!" }
// EXIST: { lookupString:"getInstance", itemText:"Calendar.getInstance", tailText:"(TimeZone!) (java.util)", typeText:"Calendar!" }
// EXIST: { lookupString:"getInstance", itemText:"Calendar.getInstance", tailText:"(TimeZone!, Locale!) (java.util)", typeText:"Calendar!" }
// EXIST: { lookupString:"getInstance", itemText:"Calendar.getInstance", tailText:"() (java.util)", typeText:"Calendar!", attributes:"" }
// EXIST: { lookupString:"getInstance", itemText:"Calendar.getInstance", tailText:"(TimeZone!) (java.util)", typeText:"Calendar!", attributes:"" }
// EXIST: { lookupString:"getInstance", itemText:"Calendar.getInstance", tailText:"(TimeZone!, Locale!) (java.util)", typeText:"Calendar!", attributes:"" }