Smart completion after "by" and "in": non-imported operators supported
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
package dependency
|
||||
|
||||
interface X
|
||||
interface Y : X
|
||||
interface Z
|
||||
|
||||
operator fun X.contains(s: String): Boolean = true
|
||||
fun Z.contains(s: String): Boolean = true
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import dependency.X
|
||||
import dependency.Y
|
||||
import dependency.Z
|
||||
|
||||
fun foo(s: String, x: X, y: Y, z: Z) {
|
||||
if (s in <caret>)
|
||||
}
|
||||
|
||||
// EXIST: x
|
||||
// EXIST: y
|
||||
// ABSENT: z
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package dependency
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
import main.C
|
||||
|
||||
class X1 {
|
||||
operator fun getValue(thisRef: C, property: KProperty<*>): String = ""
|
||||
}
|
||||
class X2 {
|
||||
operator fun getValue(thisRef: String, property: KProperty<*>): String = ""
|
||||
}
|
||||
class X3 {
|
||||
operator fun getValue(thisRef: Any, property: KProperty<*>): String = ""
|
||||
}
|
||||
|
||||
class Y1
|
||||
class Y2
|
||||
class Y3
|
||||
|
||||
operator fun Y1.getValue(thisRef: C, property: KProperty<*>): String = ""
|
||||
operator fun Y2.getValue(thisRef: String, property: KProperty<*>): String = ""
|
||||
operator fun Y3.getValue(thisRef: Any, property: KProperty<*>): String = ""
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import dependency.X1
|
||||
import dependency.X2
|
||||
import dependency.X3
|
||||
import dependency.Y1
|
||||
import dependency.Y2
|
||||
import dependency.Y3
|
||||
|
||||
fun createX1() = X1()
|
||||
fun createX2() = X2()
|
||||
fun createX3() = X3()
|
||||
fun createY1() = Y1()
|
||||
fun createY2() = Y2()
|
||||
fun createY3() = Y3()
|
||||
|
||||
class C {
|
||||
val property by <caret>
|
||||
}
|
||||
|
||||
// EXIST: createX1
|
||||
// ABSENT: createX2
|
||||
// EXIST: createX3
|
||||
// EXIST: createY1
|
||||
// ABSENT: createY2
|
||||
// EXIST: createY3
|
||||
Reference in New Issue
Block a user