Classify explicitly imported names higher than default imported in completion. Related to #KT-13447
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
+9
@@ -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" }
|
||||
+6
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user