mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
first member in call chains should not have parameters (IDEA-110961)
This commit is contained in:
+3
-1
@@ -284,7 +284,9 @@ public class ReferenceExpressionCompletionContributor {
|
||||
final PsiType expectedType = parameters.getExpectedType();
|
||||
if (!OBJECT_METHOD_PATTERN.accepts(object) || allowGetClass(object, parameters)) {
|
||||
if (parameters.getParameters().getInvocationCount() >= 3 || !itemType.equalsToText(CommonClassNames.JAVA_LANG_STRING)) {
|
||||
addChainedCallVariants(element, baseItem, result, itemType, expectedType, parameters);
|
||||
if (!(object instanceof PsiMethod && ((PsiMethod)object).getParameterList().getParametersCount() > 0)) {
|
||||
addChainedCallVariants(element, baseItem, result, itemType, expectedType, parameters);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
class Bar {
|
||||
Goo getGoo(int a);
|
||||
Goo getGoo2(int a);
|
||||
}
|
||||
class Goo {}
|
||||
|
||||
class Foo {
|
||||
Bar getBar() {}
|
||||
Bar getBar(int a) {}
|
||||
|
||||
|
||||
{
|
||||
Goo g = <caret>
|
||||
}
|
||||
}
|
||||
+4
@@ -38,6 +38,10 @@ public class SecondSmartTypeCompletionTest extends LightFixtureCompletionTestCas
|
||||
configure();
|
||||
assertStringItems("b.getGoo", "getBar().getGoo");
|
||||
}
|
||||
public void testFirstMethodWithParams() throws Throwable {
|
||||
configure();
|
||||
assertStringItems("getBar().getGoo", "getBar().getGoo2");
|
||||
}
|
||||
|
||||
public void testSuggestArraysAsList() throws Throwable { doTest(); }
|
||||
public void testSuggestArraysAsListWildcard() throws Throwable { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user