Formatting: exactly one space after for keyword

This commit is contained in:
Pavel V. Talanov
2013-10-29 14:39:45 +04:00
parent e19373cac7
commit 77d316902c
4 changed files with 24 additions and 0 deletions
@@ -88,6 +88,8 @@ public class JetFormattingModelBuilder implements FormattingModelBuilder {
.afterInside(LT, TYPE_ARGUMENT_LIST).spaces(0)
.beforeInside(GT, TYPE_ARGUMENT_LIST).spaces(0)
.betweenInside(FOR_KEYWORD, LPAR, FOR).spacing(1, 1, 0, false, 0)
// TODO: Ask for better API
// Type of the declaration colon
.beforeInside(COLON, PROPERTY).spaceIf(jetSettings.SPACE_BEFORE_TYPE_COLON)
@@ -0,0 +1,8 @@
fun f() {
for (i in array(1, 2)) {
}
for (i in array(1, 2)) {
}
for (i in array(1, 2)) {
}
}
+9
View File
@@ -0,0 +1,9 @@
fun f() {
for(i in array(1, 2)) {
}
for (i in array(1, 2)) {
}
for
(i in array(1, 2)) {
}
}
@@ -67,6 +67,11 @@ public class JetFormatterTestGenerated extends AbstractJetFormatterTest {
doTest("idea/testData/formatter/ForNoBraces.kt");
}
@TestMetadata("ForSpacing.kt")
public void testForSpacing() throws Exception {
doTest("idea/testData/formatter/ForSpacing.kt");
}
@TestMetadata("FunctionCallParametersAlign.kt")
public void testFunctionCallParametersAlign() throws Exception {
doTest("idea/testData/formatter/FunctionCallParametersAlign.kt");