mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
IDEA-53346 Extra pair of parentheses when completing a constructor call
This commit is contained in:
@@ -96,6 +96,9 @@ public class DefaultInsertHandler extends TemplateInsertHandler implements Clone
|
||||
if (completionChar == Lookup.COMPLETE_STATEMENT_SELECT_CHAR) {
|
||||
tailType = TailType.SMART_COMPLETION;
|
||||
}
|
||||
if (myLookupItem.getAttribute(LookupItem.NEW_OBJECT_ATTR) != null && completionChar == '(') {
|
||||
tailType = TailType.NONE;
|
||||
}
|
||||
|
||||
myState = new InsertHandlerState(myContext.getSelectionEndOffset(), myContext.getSelectionEndOffset());
|
||||
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
public class Foo {
|
||||
String s = new Strin<caret>
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
public class Foo {
|
||||
String s = new String(<caret>)
|
||||
}
|
||||
@@ -494,6 +494,12 @@ public class NormalCompletionTest extends LightCompletionTestCase {
|
||||
checkResultByFile("/codeInsight/completion/normal/" + getTestName(false) + "_after.java");
|
||||
}
|
||||
|
||||
public void testFinishClassNameWithLParen() throws Throwable {
|
||||
configureByFile("/codeInsight/completion/normal/" + getTestName(false) + ".java");
|
||||
type('(');
|
||||
checkResultByFile("/codeInsight/completion/normal/" + getTestName(false) + "_after.java");
|
||||
}
|
||||
|
||||
public void testSelectNoParameterSignature() throws Throwable {
|
||||
configureByFile("/codeInsight/completion/normal/" + getTestName(false) + ".java");
|
||||
final int parametersCount = ((PsiMethod)getLookup().getCurrentItem().getObject()).getParameterList().getParametersCount();
|
||||
|
||||
Reference in New Issue
Block a user