mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-76874 Basic completion doesn't show methods when they do not suite by return type
This commit is contained in:
@@ -267,8 +267,6 @@ public class JavaCompletionContributor extends CompletionContributor {
|
||||
if (reference instanceof PsiJavaReference) {
|
||||
final ElementFilter filter = getReferenceFilter(position);
|
||||
if (filter != null) {
|
||||
boolean filterVoid = JavaSmartCompletionContributor.getExpectedTypes(parameters).length > 0 && parameters.getInvocationCount() < 2;
|
||||
|
||||
final boolean isSwitchLabel = SWITCH_LABEL.accepts(position);
|
||||
final PsiFile originalFile = parameters.getOriginalFile();
|
||||
for (LookupElement element : JavaCompletionUtil.processJavaReference(position,
|
||||
@@ -290,11 +288,6 @@ public class JavaCompletionContributor extends CompletionContributor {
|
||||
item.setTailType(TailType.NONE);
|
||||
}
|
||||
|
||||
Object object = element.getObject();
|
||||
if (filterVoid && object instanceof PsiMethod && PsiType.VOID.equals(((PsiMethod)object).getReturnType())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
result.addElement(element);
|
||||
}
|
||||
}
|
||||
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
public class Foo {
|
||||
Object foo(){
|
||||
return noti<caret>
|
||||
}
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
public class Foo {
|
||||
Object foo(){
|
||||
return notify<caret>
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -47,7 +47,7 @@ public class NormalCompletionOrderingTest extends CompletionSortingTestCase {
|
||||
}
|
||||
|
||||
public void testReturnF() throws Throwable {
|
||||
checkPreferredItems(0, "false");
|
||||
checkPreferredItems(0, "false", "finalize");
|
||||
}
|
||||
|
||||
public void testPreferDefaultTypeToExpected() throws Throwable {
|
||||
|
||||
+1
-11
@@ -727,7 +727,7 @@ public class NormalCompletionTest extends LightFixtureCompletionTestCase {
|
||||
|
||||
public void testDoubleFalse() throws Throwable {
|
||||
configureByFile(getTestName(false) + ".java");
|
||||
assertStringItems("false", "fefefef");
|
||||
assertStringItems("false", "fefefef", "finalize");
|
||||
}
|
||||
|
||||
public void testSameNamedVariableInNestedClasses() throws Throwable {
|
||||
@@ -895,16 +895,6 @@ public class NormalCompletionTest extends LightFixtureCompletionTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testVoidMethodsInNonVoidContext() throws Throwable {
|
||||
configure()
|
||||
checkResultByFile(getTestName(false) + ".java")
|
||||
assertEmpty(myItems)
|
||||
assertNull(getLookup());
|
||||
|
||||
myFixture.complete(CompletionType.BASIC, 2)
|
||||
checkResult()
|
||||
}
|
||||
|
||||
public void testEnumConstantFromEnumMember() throws Throwable { doTest(); }
|
||||
|
||||
public void testPrimitiveMethodParameter() throws Throwable { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user