mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
exclude from completion should also affect implicitly imported items (IDEA-68605)
This commit is contained in:
@@ -438,7 +438,7 @@ public class JavaCompletionUtil {
|
||||
if (item != null) {
|
||||
final Object o = item.getObject();
|
||||
if (o instanceof PsiClass) {
|
||||
if (!isSourceLevelAccessible(element, (PsiClass)o, pkgContext)) {
|
||||
if (!isSourceLevelAccessible(element, (PsiClass)o, pkgContext) || isInExcludedPackage((PsiClass)o)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
public class Main {
|
||||
StringBuf<caret>
|
||||
}
|
||||
+10
@@ -396,6 +396,16 @@ public class NormalCompletionTest extends LightFixtureCompletionTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testExcludeStringBuffer() throws Throwable {
|
||||
CodeInsightSettings.getInstance().EXCLUDED_PACKAGES = [StringBuffer.name] as String[]
|
||||
try {
|
||||
doAntiTest()
|
||||
}
|
||||
finally {
|
||||
CodeInsightSettings.getInstance().EXCLUDED_PACKAGES = new String[0]
|
||||
}
|
||||
}
|
||||
|
||||
public void testAtUnderClass() throws Throwable {
|
||||
doTest();
|
||||
}
|
||||
|
||||
+4
@@ -417,6 +417,10 @@ public class GroovyCompletionContributor extends CompletionContributor {
|
||||
object = ((GroovyResolveResult)object).getElement();
|
||||
}
|
||||
|
||||
if (object instanceof PsiClass && JavaCompletionUtil.isInExcludedPackage((PsiClass)object)) {
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean autopopup = parameters.getInvocationCount() == 0;
|
||||
//skip default groovy methods
|
||||
if (firstCompletionInvoked &&
|
||||
|
||||
+11
@@ -777,6 +777,17 @@ class Fopppp {
|
||||
''')
|
||||
}
|
||||
|
||||
public void testExcludeStringBuffer() {
|
||||
assert doContainsTest('StringBuffer', 'StringBuff<caret>f')
|
||||
CodeInsightSettings.getInstance().EXCLUDED_PACKAGES = [StringBuffer.name] as String[]
|
||||
try {
|
||||
assert !doContainsTest('StringBuffer', 'StringBuff<caret>f')
|
||||
}
|
||||
finally {
|
||||
CodeInsightSettings.getInstance().EXCLUDED_PACKAGES = new String[0]
|
||||
}
|
||||
}
|
||||
|
||||
private doContainsTest(String itemToCheck, String text) {
|
||||
myFixture.configureByText "a.groovy", text
|
||||
|
||||
|
||||
Reference in New Issue
Block a user