mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-68684 Extra parenthesis and semicolon in inserted by smart completion of array type initializer in some cases
This commit is contained in:
@@ -959,11 +959,10 @@ public class ExpectedTypesProvider {
|
||||
|
||||
private static TailType getMethodArgumentTailType(final PsiExpression argument, final int index, final PsiMethod method, final PsiSubstitutor substitutor,
|
||||
final PsiParameter[] params) {
|
||||
if (index >= params.length) {
|
||||
if (index >= params.length || index == params.length - 2 && params[index + 1].isVarArgs()) {
|
||||
return TailType.NONE;
|
||||
}
|
||||
if (index == params.length - 1 || index == params.length - 2 && params[index + 1].isVarArgs()) {
|
||||
//myTailType = CompletionUtil.NONE_TAIL;
|
||||
if (index == params.length - 1) {
|
||||
final PsiElement call = argument.getParent().getParent();
|
||||
if (call instanceof JspMethodCall) return TailType.NONE;
|
||||
|
||||
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class Super {
|
||||
void foo(String[] params, int... indices) {
|
||||
foo(new String[<caret>], 0);
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class Super {
|
||||
void foo(String[] params, int... indices) {
|
||||
foo(new <caret>, 0);
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@ class Foooo {
|
||||
int bar(int a, Object... varargs) {}
|
||||
|
||||
int foo() {
|
||||
bar(hashCode())<caret>;
|
||||
bar(hashCode()<caret>);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
@@ -1010,6 +1010,7 @@ public class SmartTypeCompletionTest extends LightFixtureCompletionTestCase {
|
||||
doItemTest();
|
||||
}
|
||||
|
||||
public void testArrayInitializerBeforeVarargs() throws Throwable { doTest(); }
|
||||
public void testInheritorMembers() throws Throwable { doTest(); }
|
||||
public void testInheritorEnumMembers() throws Throwable { doTest(); }
|
||||
public void testDuplicateMembersFromSuperClass() throws Throwable { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user