KT-13728 Implicitly imported functions should be above in completion then non-imported
#KT-13728 Fixed
This commit is contained in:
@@ -230,6 +230,7 @@ object PreferMatchingItemWeigher : LookupElementWeigher("kotlin.preferMatching",
|
||||
keywordExactMatch,
|
||||
defaultExactMatch,
|
||||
functionExactMatch,
|
||||
notImportedExactMatch,
|
||||
specialExactMatch,
|
||||
notExactMatch
|
||||
}
|
||||
@@ -248,6 +249,7 @@ object PreferMatchingItemWeigher : LookupElementWeigher("kotlin.preferMatching",
|
||||
val smartCompletionPriority = element.getUserData(SMART_COMPLETION_ITEM_PRIORITY_KEY)
|
||||
when {
|
||||
smartCompletionPriority != null && smartCompletionPriority != SmartCompletionItemPriority.DEFAULT -> Weight.specialExactMatch
|
||||
element.getUserData(NOT_IMPORTED_KEY) != null -> Weight.notImportedExactMatch
|
||||
o.descriptor is FunctionDescriptor -> Weight.functionExactMatch
|
||||
else -> Weight.defaultExactMatch
|
||||
}
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package other
|
||||
|
||||
class TODO
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package kotlin
|
||||
|
||||
public inline fun TODO(): Nothing = throw NotImplementedError()
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
fun foo(): Any? = TODO<caret>
|
||||
|
||||
// WITH_ORDER
|
||||
// EXIST: { itemText: "TODO", tailText:"() (kotlin)" }
|
||||
// EXIST: { itemText: "TODO", tailText:" (other)" }
|
||||
+6
@@ -95,6 +95,12 @@ public class MultiFileJvmBasicCompletionTestGenerated extends AbstractMultiFileJ
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ExactMatchPreferImported")
|
||||
public void testExactMatchPreferImported() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/ExactMatchPreferImported/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("ExcludedClass")
|
||||
public void testExcludedClass() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/ExcludedClass/");
|
||||
|
||||
Reference in New Issue
Block a user