Tweak spacing in do-while

This commit is contained in:
Nikolay Krasko
2013-11-11 17:15:08 +04:00
parent dddde11c6a
commit 80ab043d21
4 changed files with 50 additions and 0 deletions
@@ -93,6 +93,10 @@ public class JetFormattingModelBuilder implements FormattingModelBuilder {
.betweenInside(FOR_KEYWORD, LPAR, FOR).spacing(1, 1, 0, false, 0)
.betweenInside(IF_KEYWORD, LPAR, IF).spacing(1, 1, 0, false, 0)
.betweenInside(WHILE_KEYWORD, LPAR, WHILE).spacing(1, 1, 0, false, 0)
.betweenInside(WHILE_KEYWORD, LPAR, DO_WHILE).spacing(1, 1, 0, false, 0)
.aroundInside(WHILE_KEYWORD, DO_WHILE).spaces(1)
.afterInside(DO_KEYWORD, DO_WHILE).spaces(1)
// TODO: Ask for better API
// Type of the declaration colon
@@ -0,0 +1,20 @@
fun test() {
do {
} while (true)
do {
} while (true)
do
{
}
while (true)
do
{
}
while (true)
do {
} while (true)
}
+21
View File
@@ -0,0 +1,21 @@
fun test() {
do {
} while (true)
do{
}while(true)
do
{
}
while
(true)
do
{
}
while (true)
do {
} while (true)
}
@@ -58,6 +58,11 @@ public class JetFormatterTestGenerated extends AbstractJetFormatterTest {
doTest("idea/testData/formatter/ConsecutiveCalls.kt");
}
@TestMetadata("DoWhileSpacing.kt")
public void testDoWhileSpacing() throws Exception {
doTest("idea/testData/formatter/DoWhileSpacing.kt");
}
@TestMetadata("EmptyLineAfterPackage.kt")
public void testEmptyLineAfterPackage() throws Exception {
doTest("idea/testData/formatter/EmptyLineAfterPackage.kt");