Temporarily disabled optimization for faster non-imported extensions completion because it causes duplicated items, added test for this problem
This commit is contained in:
@@ -199,12 +199,13 @@ public class KotlinIndicesHelper(private val project: Project,
|
||||
module: ModuleDescriptor,
|
||||
bindingContext: BindingContext): Collection<CallableDescriptor> {
|
||||
val fqnString = callableFQN.asString()
|
||||
val descriptors = if (index != null) {
|
||||
val descriptors = /* this code is temporarily disabled because taking descriptors from another resolve session causes duplicates and potentially other problems*/
|
||||
/*if (index != null) {
|
||||
index.get(fqnString, project, scope)
|
||||
.filter { it.getReceiverTypeReference() != null }
|
||||
.map { it.getLazyResolveSession().resolveToDescriptor(it) as CallableDescriptor }
|
||||
}
|
||||
else {
|
||||
else*/ run {
|
||||
val importDirective = JetPsiFactory(project).createImportDirective(fqnString)
|
||||
analyzeImportReference(importDirective, resolutionScope, BindingTraceContext(), module)
|
||||
.filterIsInstance(javaClass<CallableDescriptor>())
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
package ppp
|
||||
|
||||
class C
|
||||
|
||||
fun C.extFun1(){}
|
||||
fun C.extFun2(){}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package ppp
|
||||
|
||||
fun f() {
|
||||
C().ext<caret>
|
||||
}
|
||||
|
||||
// EXIST: extFun1
|
||||
// EXIST: extFun2
|
||||
// NUMBER: 2
|
||||
+6
-1
@@ -19,7 +19,6 @@ package org.jetbrains.jet.completion;
|
||||
import com.intellij.testFramework.TestDataPath;
|
||||
import org.jetbrains.jet.JUnit3RunnerWithInners;
|
||||
import org.jetbrains.jet.JetTestUtils;
|
||||
import org.jetbrains.jet.test.InnerTestClasses;
|
||||
import org.jetbrains.jet.test.TestMetadata;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
@@ -120,6 +119,12 @@ public class MultiFileJvmBasicCompletionTestGenerated extends AbstractMultiFileJ
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("NoExtensionMethodDuplication")
|
||||
public void testNoExtensionMethodDuplication() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/basic/multifile/NoExtensionMethodDuplication/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("NotImportedExtensionForImplicitReceiver")
|
||||
public void testNotImportedExtensionForImplicitReceiver() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/testData/completion/basic/multifile/NotImportedExtensionForImplicitReceiver/");
|
||||
|
||||
Reference in New Issue
Block a user