mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
Do not reformat parent code block on "complete current statement" action (IDEA-102479)
This commit is contained in:
@@ -189,13 +189,7 @@ public class JavaSmartEnterProcessor extends SmartEnterProcessor {
|
||||
return;
|
||||
}
|
||||
PsiElement parent = atCaret.getParent();
|
||||
if (parent instanceof PsiCodeBlock) {
|
||||
final PsiCodeBlock block = (PsiCodeBlock) parent;
|
||||
if (block.getStatements().length > 0 && block.getStatements()[0] == atCaret) {
|
||||
atCaret = block;
|
||||
}
|
||||
}
|
||||
else if (parent instanceof PsiForStatement) {
|
||||
if (parent instanceof PsiForStatement) {
|
||||
atCaret = parent;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
|
||||
class Foo {
|
||||
abstract void a();
|
||||
|
||||
{
|
||||
a();<caret>
|
||||
a();
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,7 @@
|
||||
|
||||
class Foo {
|
||||
abstract void a();
|
||||
|
||||
{
|
||||
a();<caret>
|
||||
a();
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
class Foo {
|
||||
boolean a;
|
||||
|
||||
{
|
||||
if (a) {
|
||||
} else {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
public class Test {
|
||||
public void foo(int x) {
|
||||
int a = 2<caret>
|
||||
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
public class Test {
|
||||
public void foo(int x) {
|
||||
int a = 2;
|
||||
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
System.out.println("");
|
||||
}
|
||||
}
|
||||
@@ -67,6 +67,8 @@ public class CompleteStatementTest extends EditorActionTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testNoBlockReformat() { doTest(); }
|
||||
|
||||
public void testCompleteCatchWithExpression() throws Exception { doTest(); }
|
||||
|
||||
public void testCompleteCatchBody() throws Exception { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user