Formatting: exactly one space after for keyword
This commit is contained in:
@@ -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)) {
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user