mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
java: handle { after if/while statement condition and insert new block statement if needed
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
class C {
|
||||
boolean f() {
|
||||
if (f()) {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class C {
|
||||
boolean f() {
|
||||
if (f()<caret>)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class C {
|
||||
boolean f() {
|
||||
while (f()) {
|
||||
<caret>
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class C {
|
||||
boolean f() {
|
||||
while (f()<caret>)
|
||||
}
|
||||
}
|
||||
@@ -74,6 +74,14 @@ public class JavaTypingTest extends LightPlatformCodeInsightFixtureTestCase {
|
||||
myFixture.checkResultByFile(getTestName(true) + "_after.java");
|
||||
}
|
||||
|
||||
public void testFixIfByBrace() {
|
||||
doTest('{');
|
||||
}
|
||||
|
||||
public void testFixWhileByBrace() {
|
||||
doTest('{');
|
||||
}
|
||||
|
||||
private void doTest(char c) {
|
||||
myFixture.configureByFile(getTestName(true) + "_before.java");
|
||||
myFixture.type(c);
|
||||
|
||||
Reference in New Issue
Block a user