IDEA-68563 complete current statement generates invalid cod

Corrected completion of 'return' expression inside non-void method
This commit is contained in:
Denis Zhdanov
2011-07-14 13:10:11 +04:00
parent 7e7773d3c8
commit 9ec2ec69b9
5 changed files with 98 additions and 18 deletions
@@ -0,0 +1,7 @@
public class Foo {
public String foo() {
return String.valueOf(
1<caret>
)
}
}
@@ -0,0 +1,7 @@
public class Foo {
public String foo() {
return String.valueOf(
1
);<caret>
}
}
@@ -228,6 +228,8 @@ public class CompleteStatementTest extends EditorActionTestCase {
public void testLastJavadocParameterDescriptionToReturn() throws Exception { doTest(); }
public void testCompleteMethodCallAtReturn() throws Exception { doTest(); }
private void doTestBracesNextLineStyle() throws Exception {
CodeStyleSettings settings = CodeStyleSettingsManager.getSettings(getProject());
settings.BRACE_STYLE = CommonCodeStyleSettings.NEXT_LINE;