diff --git a/java/java-impl/src/com/intellij/codeInsight/completion/ConstructorInsertHandler.java b/java/java-impl/src/com/intellij/codeInsight/completion/ConstructorInsertHandler.java index 03369610d3c3..9e61965f730f 100644 --- a/java/java-impl/src/com/intellij/codeInsight/completion/ConstructorInsertHandler.java +++ b/java/java-impl/src/com/intellij/codeInsight/completion/ConstructorInsertHandler.java @@ -194,6 +194,7 @@ public class ConstructorInsertHandler implements InsertHandler + } +} \ No newline at end of file diff --git a/java/java-tests/testData/codeInsight/completion/signature/NewAnonymousInMethodArgTemplate_after.java b/java/java-tests/testData/codeInsight/completion/signature/NewAnonymousInMethodArgTemplate_after.java new file mode 100644 index 000000000000..1d4ad2405673 --- /dev/null +++ b/java/java-tests/testData/codeInsight/completion/signature/NewAnonymousInMethodArgTemplate_after.java @@ -0,0 +1,10 @@ +abstract class A { + A(int x){} + abstract void foo(); + void test(A a){} + + { + test(new A(x) { + }); + } +} \ No newline at end of file diff --git a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SignatureCompletionTest.groovy b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SignatureCompletionTest.groovy index bed15ad0b482..3914cad4eacf 100644 --- a/java/java-tests/testSrc/com/intellij/codeInsight/completion/SignatureCompletionTest.groovy +++ b/java/java-tests/testSrc/com/intellij/codeInsight/completion/SignatureCompletionTest.groovy @@ -76,4 +76,12 @@ class SignatureCompletionTest extends LightFixtureCompletionTestCase { checkResult() } + void testNewAnonymousInMethodArgTemplate() { + configureByTestName() + myFixture.type('new ') + myFixture.complete(CompletionType.SMART) + myFixture.type('\n') + checkResult() + } + }