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,
|
keywordExactMatch,
|
||||||
defaultExactMatch,
|
defaultExactMatch,
|
||||||
functionExactMatch,
|
functionExactMatch,
|
||||||
|
notImportedExactMatch,
|
||||||
specialExactMatch,
|
specialExactMatch,
|
||||||
notExactMatch
|
notExactMatch
|
||||||
}
|
}
|
||||||
@@ -248,6 +249,7 @@ object PreferMatchingItemWeigher : LookupElementWeigher("kotlin.preferMatching",
|
|||||||
val smartCompletionPriority = element.getUserData(SMART_COMPLETION_ITEM_PRIORITY_KEY)
|
val smartCompletionPriority = element.getUserData(SMART_COMPLETION_ITEM_PRIORITY_KEY)
|
||||||
when {
|
when {
|
||||||
smartCompletionPriority != null && smartCompletionPriority != SmartCompletionItemPriority.DEFAULT -> Weight.specialExactMatch
|
smartCompletionPriority != null && smartCompletionPriority != SmartCompletionItemPriority.DEFAULT -> Weight.specialExactMatch
|
||||||
|
element.getUserData(NOT_IMPORTED_KEY) != null -> Weight.notImportedExactMatch
|
||||||
o.descriptor is FunctionDescriptor -> Weight.functionExactMatch
|
o.descriptor is FunctionDescriptor -> Weight.functionExactMatch
|
||||||
else -> Weight.defaultExactMatch
|
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);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("ExactMatchPreferImported")
|
||||||
|
public void testExactMatchPreferImported() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/ExactMatchPreferImported/");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("ExcludedClass")
|
@TestMetadata("ExcludedClass")
|
||||||
public void testExcludedClass() throws Exception {
|
public void testExcludedClass() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/ExcludedClass/");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/ExcludedClass/");
|
||||||
|
|||||||
Reference in New Issue
Block a user