Smart completion: expected type instantiation made higher priority than static members

This commit is contained in:
Valentin Kipyatkov
2015-04-03 17:42:05 +03:00
parent e2979614ad
commit 2c1a0a0c4b
4 changed files with 24 additions and 2 deletions
@@ -268,8 +268,8 @@ enum class SmartCompletionItemPriority {
THIS
DEFAULT
NULLABLE
STATIC_MEMBER
INSTANTIATION
STATIC_MEMBER
ANONYMOUS_OBJECT
LAMBDA_NO_PARAMS
LAMBDA
@@ -11,5 +11,5 @@ fun bar() {
}
// ORDER: it
// ORDER: create
// ORDER: Name
// ORDER: create
@@ -0,0 +1,16 @@
class C {
companion object {
val INSTANCE = C()
fun create() = C()
}
}
fun foo(p: C) {
foo(<caret>)
}
// ORDER: p
// ORDER: C
// ORDER: INSTANCE
// ORDER: create
@@ -203,4 +203,10 @@ public class SmartCompletionWeigherTestGenerated extends AbstractSmartCompletion
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/weighers/smart/SmartPriority2.kt");
doTest(fileName);
}
@TestMetadata("SmartPriority3.kt")
public void testSmartPriority3() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/weighers/smart/SmartPriority3.kt");
doTest(fileName);
}
}