Callable reference completion for non-imported callables

This commit is contained in:
Valentin Kipyatkov
2015-10-01 19:07:18 +03:00
parent 3a2bc51445
commit 08335a2ac9
21 changed files with 193 additions and 127 deletions
@@ -0,0 +1,9 @@
package dependency
fun CharSequence.extFun(){}
fun Int.wrongExtFun(){}
fun topLevelFun(){}
val topLevelVal: Int = 1
@@ -0,0 +1,9 @@
fun String.foo() {
val v = ::<caret>
}
// INVOCATION_COUNT: 2
// EXIST: extFun
// EXIST: topLevelFun
// EXIST: topLevelVal
// ABSENT: wrongExtFun
@@ -0,0 +1,7 @@
package dependency
fun CharSequence.extFun(){}
val String.extVal: Int get() = 1
fun Int.wrongExtFun(){}
@@ -0,0 +1,5 @@
val v = String::<caret>
// EXIST: extFun
// EXIST: extVal
// ABSENT: wrongExtFun
@@ -0,0 +1,4 @@
val v = ::tim<caret>
// INVOCATION_COUNT: 2
// ELEMENT: timerTask
@@ -0,0 +1,6 @@
import kotlin.concurrent.timerTask
val v = ::timerTask<caret>
// INVOCATION_COUNT: 2
// ELEMENT: timerTask
@@ -1,5 +1,3 @@
fun foo() {
KtCla<caret>
}
// ELEMENT: KtClass
@@ -3,5 +3,3 @@ import pack.KtClass
fun foo() {
KtClass<caret>
}
// ELEMENT: KtClass
@@ -0,0 +1,3 @@
fun foo() {
val v = String::myExtFu<caret>
}
@@ -0,0 +1,3 @@
package dependency
fun String.myExtFun(){}
@@ -0,0 +1,5 @@
import dependency.myExtFun
fun foo() {
val v = String::myExtFun<caret>
}
@@ -0,0 +1,7 @@
package dependency
fun String.extFun(){}
fun String.wrongExtFun(p: Int){}
fun topLevelFun(){}
fun wrongTopLevelFun(p: Int){}
@@ -0,0 +1,13 @@
fun String.foo() {
bar(::<caret>)
}
fun bar(p: () -> Unit) { }
fun bar(p: String.() -> Unit) { }
// INVOCATION_COUNT: 2
// EXIST: extFun
// EXIST: topLevelFun
// ABSENT: wrongExtFun
// ABSENT: wrongTopLevelFun