Added test for second press completion for inaccessible

This commit is contained in:
Valentin Kipyatkov
2015-06-10 16:05:27 +03:00
parent 483da9607c
commit 3d0c3e225e
4 changed files with 24 additions and 1 deletions
@@ -66,7 +66,6 @@ public class ReferenceVariantsHelper(
val variants = getReferenceVariantsNoVisibilityFilter(expression, kindFilter, useRuntimeReceiverType, nameFilter)
.filter(visibilityFilter)
return ShadowedDeclarationsFilter(context, moduleDescriptor, project).filter(variants, expression)
//TODO: if visibility filter is empty, filter out shadowed can work incorrectly!
}
private fun getReferenceVariantsNoVisibilityFilter(
@@ -0,0 +1,4 @@
package dependency
fun Any.xxx(): Int = 1
private fun ppp.C.xxx(): Int = 1
@@ -0,0 +1,14 @@
package ppp
import dependency.*
class C
fun foo(c: C) {
c.xx<caret>
}
// we should not include inaccessible extension even on the second completion because the call won't resolve into it anyway
// INVOCATION_COUNT: 2
// EXIST: { lookupString: "xxx", itemText: "xxx", tailText: "() for Any in dependency", typeText: "Int" }
// NOTHING_ELSE
@@ -113,6 +113,12 @@ public class MultiFileJvmBasicCompletionTestGenerated extends AbstractMultiFileJ
doTest(fileName);
}
@TestMetadata("MoreSpecificExtensionIsPrivate")
public void testMoreSpecificExtensionIsPrivate() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/MoreSpecificExtensionIsPrivate/");
doTest(fileName);
}
@TestMetadata("NoAutoInsertionOfNotImported")
public void testNoAutoInsertionOfNotImported() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/idea-completion/testData/basic/multifile/NoAutoInsertionOfNotImported/");