Tweak spacing in do-while
This commit is contained in:
@@ -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)
|
||||
}
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user