mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
java smart enter: place caret inside braces for switch statement followed by an empty line
This commit is contained in:
@@ -99,6 +99,10 @@ public class PlainEnterProcessor implements EnterProcessor {
|
||||
if (methodBody != null) return methodBody;
|
||||
}
|
||||
|
||||
if (element instanceof PsiSwitchStatement) {
|
||||
return ((PsiSwitchStatement)element).getBody();
|
||||
}
|
||||
|
||||
PsiStatement body = null;
|
||||
if (element instanceof PsiIfStatement) {
|
||||
body = ((PsiIfStatement)element).getThenBranch();
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
class foo {
|
||||
void foo() {
|
||||
switch (i<caret>)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
class foo {
|
||||
void foo() {
|
||||
switch (i) {
|
||||
<caret>
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -218,6 +218,7 @@ public class CompleteStatementTest extends EditorActionTestCase {
|
||||
public void testSwitchKeyword() throws Exception { doTest(); }
|
||||
|
||||
public void testSwitchKeywordWithCondition() throws Exception { doTest(); }
|
||||
public void testSwitchBraces() { doTest(); }
|
||||
public void testCaseColon() { doTest(); }
|
||||
|
||||
public void testNewInParentheses() throws Exception { doTest(); }
|
||||
|
||||
Reference in New Issue
Block a user