Smart completion: this expressions added

This commit is contained in:
Valentin Kipyatkov
2013-11-27 20:15:28 +04:00
parent 29f7318f4f
commit 47d3e2e1bb
11 changed files with 191 additions and 5 deletions
@@ -0,0 +1,7 @@
class Foo{
fun String.foo(){
val foo : Foo = <caret>
}
}
// EXIST: { lookupString:"this@Foo", typeText:"Foo" }
@@ -0,0 +1,15 @@
open class Foo
fun foo(f: Foo){}
fun bar() {
foo(object: Foo() {
inner class Inner {
fun f() {
val x: Foo = <caret>
}
}
})
}
// EXIST: this@foo
@@ -0,0 +1,9 @@
class Foo{
fun String.foo(){
fun Foo.bar(){
val s: String = <caret>
}
}
}
// EXIST: { lookupString:"this@foo", typeText:"jet.String" }
@@ -0,0 +1,12 @@
fun accept1(handler: String.() -> Unit){}
fun accept2(handler: Int.() -> Unit){}
fun foo(){
accept1({
accept2({
val s: String = <caret>
})
})
}
// EXIST: this@accept1
@@ -0,0 +1,14 @@
object X {
fun accept1(handler: String.() -> Unit){}
fun accept2(handler: Int.() -> Unit){}
}
fun foo(){
X.accept1({
X.accept2({
val s: String = <caret>
})
})
}
// EXIST: this@accept1
@@ -0,0 +1,12 @@
fun<T> accept1(handler: String.(t: T) -> Unit){}
fun accept2(handler: Int.() -> Unit){}
fun foo(){
accept1<String>({
accept2({
val s: String = <caret>
})
})
}
// EXIST: this@accept1
+5
View File
@@ -0,0 +1,5 @@
fun String.foo(){
val s : String = <caret>
}
// EXIST: { lookupString:"this", typeText:"jet.String" }
@@ -1,5 +0,0 @@
fun String.foo(){
val s : String = <caret>
}
// EXIST: this