Formatting: exactly one space after if keyword

This commit is contained in:
Pavel V. Talanov
2013-10-29 14:47:06 +04:00
parent 77d316902c
commit 3e205d162e
4 changed files with 23 additions and 0 deletions
@@ -89,6 +89,7 @@ public class JetFormattingModelBuilder implements FormattingModelBuilder {
.beforeInside(GT, TYPE_ARGUMENT_LIST).spaces(0)
.betweenInside(FOR_KEYWORD, LPAR, FOR).spacing(1, 1, 0, false, 0)
.betweenInside(IF_KEYWORD, LPAR, IF).spacing(1, 1, 0, false, 0)
// TODO: Ask for better API
// Type of the declaration colon
@@ -0,0 +1,8 @@
fun f() {
if (1 == 2) {
}
if (1 == 2) {
}
if (1 == 2) {
}
}
+9
View File
@@ -0,0 +1,9 @@
fun f() {
if (1 == 2) {
}
if(1 == 2) {
}
if
(1 == 2) {
}
}
@@ -107,6 +107,11 @@ public class JetFormatterTestGenerated extends AbstractJetFormatterTest {
doTest("idea/testData/formatter/If.kt");
}
@TestMetadata("IfSpacing.kt")
public void testIfSpacing() throws Exception {
doTest("idea/testData/formatter/IfSpacing.kt");
}
@TestMetadata("KDoc.kt")
public void testKDoc() throws Exception {
doTest("idea/testData/formatter/KDoc.kt");