Completion of parameter name/types from the current file

This commit is contained in:
Valentin Kipyatkov
2015-06-18 17:51:47 +03:00
parent 22ad1389f5
commit 17500cef98
15 changed files with 233 additions and 69 deletions
@@ -0,0 +1,28 @@
import java.io.*
class X {
fun f1(strings: List<String>) { }
fun f2(numbers: List<Int>) { }
}
fun f3(strings: List<String>) { }
fun f4(value: Any?) { }
fun f5(value: File) { }
fun f6(handler: (() -> String)?) { }
class C(val handler: () -> Unit) {
companion object {
fun foo(<caret>) {
fun local(localParam: String/* it should not be included by performance reasons*/){}
}
}
}
// EXIST: { lookupString: "strings", itemText: "strings: List<String>", tailText: " (kotlin)" }
// EXIST: { lookupString: "numbers", itemText: "numbers: List<Int>", tailText: " (kotlin)" }
// EXIST: { lookupString: "value", itemText: "value: Any?", tailText: " (kotlin)" }
// EXIST_JAVA_ONLY: { lookupString: "value", itemText: "value: File", tailText: " (java.io)" }
// EXIST: { lookupString: "handler", itemText: "handler: (() -> String)?", tailText: null }
// EXIST: { lookupString: "handler", itemText: "handler: () -> Unit", tailText: null }
// ABSENT: "localParam"
// ABSENT: "file"
@@ -0,0 +1,19 @@
package ppp
import java.io.*
class X {
public class PublicNested
private class PrivateNested
fun f1(nested: PublicNested) { }
fun f2(nested: PrivateNested) { }
fun f3(nestedList: List<PublicNested>) { }
fun f4(nestedList: List<PrivateNested>) { }
}
fun foo(neste<caret>)
// EXIST: { lookupString: "nested", itemText: "nested: X.PublicNested", tailText: " (ppp)" }
// EXIST: { lookupString: "nestedList", itemText: "nestedList: List<X.PublicNested>", tailText: " (kotlin)" }
// NOTHING_ELSE