Non-imported extensions from different packages do not shadow each other

This commit is contained in:
Valentin Kipyatkov
2015-06-10 17:55:38 +03:00
parent 8d11ab9866
commit abc9c1ab02
6 changed files with 30 additions and 3 deletions
@@ -225,7 +225,6 @@ 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
return ShadowedDeclarationsFilter(bindingContext, moduleDescriptor, project).filterNonImported(extensions, referenceVariants, reference.expression)
}
@@ -0,0 +1,11 @@
package ppp
class C {
fun foo() {
xx<caret>
}
}
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: "() for Any in dependency1", typeText: "Int" }
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: "() for C in dependency2", typeText: "Int" }
// NOTHING_ELSE
@@ -0,0 +1,3 @@
package dependency1
fun Any.xxx(): Int = 1
@@ -0,0 +1,3 @@
package dependency2
fun ppp.C.xxx(): Int = 1
@@ -113,6 +113,12 @@ public class MultiFileJvmBasicCompletionTestGenerated extends AbstractMultiFileJ
doTest(fileName);
}
@TestMetadata("MoreSpecificExtensionInDifferentPackage")
public void testMoreSpecificExtensionInDifferentPackage() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/MoreSpecificExtensionInDifferentPackage/");
doTest(fileName);
}
@TestMetadata("MoreSpecificExtensionIsPrivate")
public void testMoreSpecificExtensionIsPrivate() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/MoreSpecificExtensionIsPrivate/");