KT-7195 Smart completion after "return ": the function itself should get smaller priority + declarations in the same file to have higher priority than default-imported

#KT-7195 Fixed
This commit is contained in:
Valentin Kipyatkov
2015-05-08 13:17:34 +03:00
parent 09f478fc0f
commit 892b2b0f83
11 changed files with 72 additions and 25 deletions
@@ -11,5 +11,5 @@ fun bar(p: (String) -> Boolean) {
// ORDER: p
// ORDER: {...}
// ORDER: { String -> ... }
// ORDER: ::error
// ORDER: ::x
// ORDER: ::error
@@ -1,5 +1,5 @@
val fooBar = ""
val vFooBar = ""
fun foo(s: String): String = <caret>
// ORDER: foo, fooBar, s
// ORDER: vFooBar, s, foo
@@ -1,7 +1,7 @@
val fooBar = ""
val vFooBar = ""
fun foo(s: String): String {
return <caret>
}
// ORDER: foo, fooBar, s
// ORDER: vFooBar, s, foo
@@ -0,0 +1,8 @@
fun<T> calcSomething(s: String, t: T): String {
val something = ""
return <caret>
}
// ORDER: something
// ORDER: s
// ORDER: calcSomething
@@ -0,0 +1,14 @@
class C {
val something: String = ""
val s: String = ""
fun calcSomething(c: C?): String {
if (c != null) {
return c.<caret>
}
}
}
// ORDER: calcSomething
// ORDER: something
// ORDER: s