mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-144489 "Complete current statement" creates broken code - missing closing paren on method invocation
This commit is contained in:
+1
-1
@@ -44,7 +44,7 @@ public class MethodCallFixer implements Fixer {
|
||||
|
||||
if (args != null && !hasRParenth(args)) {
|
||||
int caret = editor.getCaretModel().getOffset();
|
||||
PsiCallExpression innermostCall = PsiTreeUtil.findElementOfClassAtOffset(psiElement.getContainingFile(), caret, PsiCallExpression.class, false);
|
||||
PsiCallExpression innermostCall = PsiTreeUtil.findElementOfClassAtOffset(psiElement.getContainingFile(), caret - 1, PsiCallExpression.class, false);
|
||||
if (innermostCall == null) return;
|
||||
|
||||
args = innermostCall.getArgumentList();
|
||||
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class Main {
|
||||
public void test() {
|
||||
double[] d = new double[si<caret>];
|
||||
}
|
||||
|
||||
int size();
|
||||
int size2();
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class Main {
|
||||
public void test() {
|
||||
double[] d = new double[size()];<caret>
|
||||
}
|
||||
|
||||
int size();
|
||||
int size2();
|
||||
}
|
||||
+1
@@ -935,6 +935,7 @@ public class ListUtils {
|
||||
public void testSmartEnterNoNewLine() { doTest(Lookup.COMPLETE_STATEMENT_SELECT_CHAR as String) }
|
||||
public void testSmartEnterWithNewLine() { doTest(Lookup.COMPLETE_STATEMENT_SELECT_CHAR as String) }
|
||||
public void testSmartEnterGuessArgumentCount() throws Throwable { doTest(Lookup.COMPLETE_STATEMENT_SELECT_CHAR as String) }
|
||||
public void testSmartEnterInsideArrayBrackets() { doTest(Lookup.COMPLETE_STATEMENT_SELECT_CHAR as String) }
|
||||
|
||||
public void testTabReplacesMethodNameWithLocalVariableName() throws Throwable { doTest('\t'); }
|
||||
public void testMethodParameterAnnotationClass() throws Throwable { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user