Classify explicitly imported names higher than default imported in completion. Related to #KT-13447

This commit is contained in:
Ilya Gorbunov
2016-09-29 20:43:04 +03:00
parent 1af3b50e3d
commit adf2c5a5ac
4 changed files with 17 additions and 2 deletions
@@ -75,8 +75,8 @@ class NotImportedStaticMemberWeigher(private val classifier: ImportableFqNameCla
class ImportedWeigher(private val classifier: ImportableFqNameClassifier) : LookupElementWeigher("kotlin.imported") {
private enum class Weight {
currentPackage,
defaultImport,
preciseImport,
defaultImport,
allUnderImport
}
@@ -0,0 +1,9 @@
import java.lang.IllegalArgumentException
fun some(e: IllegalArgumentException<caret>) {
}
// INVOCATION_COUNT: 2
// WITH_ORDER
// EXIST: { lookupString:"IllegalArgumentException", tailText:" (java.lang)" }
// EXIST: { lookupString:"IllegalArgumentException", tailText: " (kotlin)", typeText:"IllegalArgumentException" }
@@ -2761,6 +2761,12 @@ public class JvmBasicCompletionTestGenerated extends AbstractJvmBasicCompletionT
doTest(fileName);
}
@TestMetadata("StandardKotlinTypeAliasAfterExplicitlyImported.kt")
public void testStandardKotlinTypeAliasAfterExplicitlyImported() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/java/StandardKotlinTypeAliasAfterExplicitlyImported.kt");
doTest(fileName);
}
@TestMetadata("StandardKotlinTypeAliasFirst.kt")
public void testStandardKotlinTypeAliasFirst() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/java/StandardKotlinTypeAliasFirst.kt");
@@ -51,8 +51,8 @@ class ImportableFqNameClassifier(private val file: KtFile) {
enum class Classification {
fromCurrentPackage,
topLevelPackage,
defaultImport,
preciseImport,
defaultImport,
allUnderImport,
siblingImported,
notImported,