Support for callable references in smart completion
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
fun foo(p: () -> Unit){}
|
||||
|
||||
fun bar() {
|
||||
foo(::xf<caret>)
|
||||
}
|
||||
|
||||
fun xf1(){}
|
||||
fun xf1(s: String){}
|
||||
fun xf2(i: Int){}
|
||||
|
||||
// EXIST: { lookupString:"xf1", itemText:"xf1", tailText: "() (<root>)", typeText: "Unit" }
|
||||
// NOTHING_ELSE
|
||||
@@ -0,0 +1,15 @@
|
||||
import kotlin.reflect.KProperty0
|
||||
|
||||
fun foo(p: KProperty0<Int>){}
|
||||
|
||||
fun bar() {
|
||||
foo(::xT<caret>)
|
||||
}
|
||||
|
||||
val xTopLevelIntVal = 1
|
||||
var xTopLevelIntVar = 1
|
||||
val xTopLevelStringVal = "1"
|
||||
|
||||
// EXIST: { lookupString:"xTopLevelIntVal", itemText:"xTopLevelIntVal", tailText: " (<root>)", typeText: "Int" }
|
||||
// EXIST: { lookupString:"xTopLevelIntVar", itemText:"xTopLevelIntVar", tailText: " (<root>)", typeText: "Int" }
|
||||
// NOTHING_ELSE
|
||||
@@ -0,0 +1,9 @@
|
||||
class C(i: Int){}
|
||||
|
||||
fun foo(p: (Int) -> C){}
|
||||
|
||||
fun bar(){
|
||||
foo(::<caret>)
|
||||
}
|
||||
|
||||
// EXIST: C
|
||||
@@ -0,0 +1,20 @@
|
||||
class C {
|
||||
fun xf1(){}
|
||||
fun xf1(s: String){}
|
||||
fun xf2(i: Int){}
|
||||
}
|
||||
|
||||
fun C.xfe1(){}
|
||||
fun C.xfe1(s: String){}
|
||||
fun C.xfe2(i: Int){}
|
||||
|
||||
|
||||
fun foo(p: C.(String) -> Unit){}
|
||||
|
||||
fun bar() {
|
||||
foo(C::<caret>)
|
||||
}
|
||||
|
||||
// EXIST: { lookupString:"xf1", itemText:"xf1", tailText: "(s: String)", typeText: "Unit" }
|
||||
// EXIST: { lookupString:"xfe1", itemText:"xfe1", tailText: "(s: String) for C in <root>", typeText: "Unit" }
|
||||
// NOTHING_ELSE
|
||||
@@ -0,0 +1,15 @@
|
||||
import kotlin.reflect.KProperty1
|
||||
|
||||
fun foo(p: KProperty1<String, Int>){}
|
||||
|
||||
fun bar() {
|
||||
foo(String::xT<caret>)
|
||||
}
|
||||
|
||||
val String.xTopLevelIntVal: Int get() = 1
|
||||
val String.xTopLevelStringVal: String get() = "1"
|
||||
val Any.xTopLevelValOnAny: Int get() = 1
|
||||
val Int.xTopLevelValOnInt: Int get() = 1
|
||||
|
||||
// EXIST: { lookupString:"xTopLevelIntVal", itemText:"xTopLevelIntVal", tailText: " for String in <root>", typeText: "Int" }
|
||||
// NOTHING_ELSE
|
||||
@@ -0,0 +1,7 @@
|
||||
fun foo(p: (() -> Unit) -> Runnable){}
|
||||
|
||||
fun bar(){
|
||||
foo(::<caret>)
|
||||
}
|
||||
|
||||
// EXIST: Runnable
|
||||
Reference in New Issue
Block a user