Non-imported extensions are excluded when shadowed by members or something
This commit is contained in:
@@ -226,8 +226,7 @@ abstract class CompletionSessionBase(protected val configuration: CompletionSess
|
||||
protected fun getTopLevelExtensions(): Collection<CallableDescriptor> {
|
||||
val extensions = indicesHelper.getCallableTopLevelExtensions({ prefixMatcher.prefixMatches(it) }, reference!!.expression)
|
||||
//TODO: it filters out too much
|
||||
//TODO: not filtered out dominated by members
|
||||
return ShadowedDeclarationsFilter(bindingContext, moduleDescriptor, project, importDeclarations = true).filter(extensions, reference.expression)
|
||||
return ShadowedDeclarationsFilter(bindingContext, moduleDescriptor, project).filterNonImported(extensions, referenceVariants, reference.expression)
|
||||
}
|
||||
|
||||
protected fun addAllClasses(kindFilter: (ClassKind) -> Boolean) {
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
package dependency
|
||||
|
||||
fun Any.xxx(): Int = 1
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
package ppp
|
||||
|
||||
import dependency.*
|
||||
|
||||
class C {
|
||||
private fun xxx() {}
|
||||
|
||||
fun foo() {
|
||||
xx<caret>
|
||||
}
|
||||
}
|
||||
|
||||
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: "()", typeText: "Unit" }
|
||||
// NOTHING_ELSE
|
||||
+6
@@ -215,6 +215,12 @@ public class MultiFileJvmBasicCompletionTestGenerated extends AbstractMultiFileJ
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PreferMemberToExtension")
|
||||
public void testPreferMemberToExtension() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/PreferMemberToExtension/");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("PreferMoreSpecificExtension1")
|
||||
public void testPreferMoreSpecificExtension1() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/PreferMoreSpecificExtension1/");
|
||||
|
||||
Reference in New Issue
Block a user