mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 13:20:53 +07:00
doPostponedFormatting after formatting in completion after new (IDEA-CR-14717)
This commit is contained in:
@@ -194,6 +194,7 @@ public class ConstructorInsertHandler implements InsertHandler<LookupElementDeco
|
||||
PsiExpressionList listToReformat = getEnclosingExpressionList(elementAtOffset.getParent());
|
||||
if (listToReformat != null) {
|
||||
CodeStyleManager.getInstance(file.getProject()).reformat(listToReformat);
|
||||
PostprocessReformattingAspect.getInstance(file.getProject()).doPostponedFormatting();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
abstract class A {
|
||||
A(int x){}
|
||||
abstract void foo();
|
||||
void test(A a){}
|
||||
|
||||
{
|
||||
tes<caret>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
abstract class A {
|
||||
A(int x){}
|
||||
abstract void foo();
|
||||
void test(A a){}
|
||||
|
||||
{
|
||||
test(new A(<selection>x<caret></selection>) {
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -76,4 +76,12 @@ class SignatureCompletionTest extends LightFixtureCompletionTestCase {
|
||||
checkResult()
|
||||
}
|
||||
|
||||
void testNewAnonymousInMethodArgTemplate() {
|
||||
configureByTestName()
|
||||
myFixture.type('new ')
|
||||
myFixture.complete(CompletionType.SMART)
|
||||
myFixture.type('\n')
|
||||
checkResult()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user