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