IDEA-106814 Insert both opening and closing parentheses when completing a method call with "Insert pair brace" option off

This commit is contained in:
peter
2013-05-22 13:31:21 +02:00
parent 00843b7869
commit 62af4ca2a1
5 changed files with 8 additions and 6 deletions
@@ -764,12 +764,14 @@ public class JavaCompletionUtil {
context.setAddCompletionChar(false);
}
final boolean needRightParenth = forceClosingParenthesis || !smart && (CodeInsightSettings.getInstance().AUTOINSERT_PAIR_BRACKET || hasTail);
if (hasTail) {
hasParams = false;
}
final boolean needRightParenth = forceClosingParenthesis ||
!smart && (CodeInsightSettings.getInstance().AUTOINSERT_PAIR_BRACKET ||
!hasParams && completionChar != '(');
PsiDocumentManager.getInstance(context.getProject()).commitDocument(context.getDocument());
context.commitDocument();
final CommonCodeStyleSettings styleSettings = context.getCodeStyleSettings();
final PsiElement elementAt = file.findElementAt(context.getStartOffset());
@@ -3,6 +3,6 @@ class MyClass {
void foo() {}
{
foo(<caret>
foo();<caret>
}
}
@@ -3,6 +3,6 @@ class MyClass {
void foo() {}
{
foo(<caret>
foo();<caret>
}
}
@@ -1,6 +1,6 @@
class A {
{
String x;
Class c = x.getClass(<caret>
Class c = x.getClass()<caret>
}
}
@@ -1,6 +1,6 @@
class A {
{
Class c = this.xxxxx(<caret>
Class c = this.xxxxx()<caret>
}
Class xxxxx() {}