mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-46653 Completion in parameter list should not insert a trailing comma if the following parameter is varargs
This commit is contained in:
@@ -953,7 +953,7 @@ public class ExpectedTypesProvider {
|
||||
if (index >= params.length) {
|
||||
return TailType.NONE;
|
||||
}
|
||||
if (index == params.length - 1) {
|
||||
if (index == params.length - 1 || index == params.length - 2 && params[index + 1].isVarArgs()) {
|
||||
//myTailType = CompletionUtil.NONE_TAIL;
|
||||
final PsiElement call = argument.getParent().getParent();
|
||||
if (call instanceof JspMethodCall) return TailType.NONE;
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class Foooo {
|
||||
int bar(int a, Object... varargs) {}
|
||||
|
||||
int foo() {
|
||||
bar(hashCode())<caret>;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
class Foooo {
|
||||
int bar(int a, Object... varargs) {}
|
||||
|
||||
int foo() {
|
||||
bar(ha<caret>);
|
||||
}
|
||||
|
||||
}
|
||||
+2
@@ -875,6 +875,8 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testNoCommaBeforeVarargs() throws Throwable { doTest(); }
|
||||
|
||||
public void testEnumField() throws Throwable {
|
||||
doItemTest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user