mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-106814 Insert both opening and closing parentheses when completing a method call with "Insert pair brace" option off
This commit is contained in:
@@ -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>
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -3,6 +3,6 @@ class MyClass {
|
||||
void foo() {}
|
||||
|
||||
{
|
||||
foo(<caret>
|
||||
foo();<caret>
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class A {
|
||||
{
|
||||
String x;
|
||||
Class c = x.getClass(<caret>
|
||||
Class c = x.getClass()<caret>
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
class A {
|
||||
{
|
||||
Class c = this.xxxxx(<caret>
|
||||
Class c = this.xxxxx()<caret>
|
||||
}
|
||||
|
||||
Class xxxxx() {}
|
||||
|
||||
Reference in New Issue
Block a user