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") {
|
class ImportedWeigher(private val classifier: ImportableFqNameClassifier) : LookupElementWeigher("kotlin.imported") {
|
||||||
private enum class Weight {
|
private enum class Weight {
|
||||||
currentPackage,
|
currentPackage,
|
||||||
defaultImport,
|
|
||||||
preciseImport,
|
preciseImport,
|
||||||
|
defaultImport,
|
||||||
allUnderImport
|
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);
|
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")
|
@TestMetadata("StandardKotlinTypeAliasFirst.kt")
|
||||||
public void testStandardKotlinTypeAliasFirst() throws Exception {
|
public void testStandardKotlinTypeAliasFirst() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/java/StandardKotlinTypeAliasFirst.kt");
|
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 {
|
enum class Classification {
|
||||||
fromCurrentPackage,
|
fromCurrentPackage,
|
||||||
topLevelPackage,
|
topLevelPackage,
|
||||||
defaultImport,
|
|
||||||
preciseImport,
|
preciseImport,
|
||||||
|
defaultImport,
|
||||||
allUnderImport,
|
allUnderImport,
|
||||||
siblingImported,
|
siblingImported,
|
||||||
notImported,
|
notImported,
|
||||||
|
|||||||
Reference in New Issue
Block a user