mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 05:21:29 +07:00
IDEA-25139: Proper caret placement for methods, if "next line" brace style is in use.
This commit is contained in:
@@ -71,6 +71,10 @@ public class PlainEnterProcessor implements EnterProcessor {
|
||||
else if (element instanceof PsiDoWhileStatement) {
|
||||
body = ((PsiDoWhileStatement)element).getBody();
|
||||
}
|
||||
else if (element instanceof PsiMethod) {
|
||||
PsiCodeBlock methodBody = ((PsiMethod)element).getBody();
|
||||
if (methodBody != null) return methodBody;
|
||||
}
|
||||
|
||||
return body instanceof PsiBlockStatement ? ((PsiBlockStatement)body).getCodeBlock() : null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
class Foo {
|
||||
@Test
|
||||
public void testValueOf(<caret>)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
class Foo {
|
||||
@Test
|
||||
public void testValueOf()
|
||||
{
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
@@ -184,7 +184,15 @@ public class CompleteStatementTest extends EditorActionTestCase {
|
||||
|
||||
public void testIDEADEV40479() throws Exception { doTest(); }
|
||||
|
||||
public void testIDEADEV13019() throws Exception {
|
||||
public void testIDEADEV13019() throws Exception {
|
||||
doTestBracesNextLineStyle();
|
||||
}
|
||||
|
||||
public void testIDEA25139() throws Exception {
|
||||
doTestBracesNextLineStyle();
|
||||
}
|
||||
|
||||
private void doTestBracesNextLineStyle() throws Exception {
|
||||
CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
|
||||
settings.BRACE_STYLE = CodeStyleSettings.NEXT_LINE;
|
||||
settings.METHOD_BRACE_STYLE = CodeStyleSettings.NEXT_LINE;
|
||||
|
||||
Reference in New Issue
Block a user