Configure spacing after 'while' in while statement
This commit is contained in:
@@ -92,6 +92,7 @@ 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)
|
||||
|
||||
// TODO: Ask for better API
|
||||
// Type of the declaration colon
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
fun test() {
|
||||
while (1 == 2) {
|
||||
}
|
||||
while (1 == 2) {
|
||||
}
|
||||
while (1 == 2) {
|
||||
}
|
||||
|
||||
while (true) {
|
||||
}
|
||||
|
||||
while (true) {
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
fun test() {
|
||||
while (1 == 2) {
|
||||
}
|
||||
while(1 == 2) {
|
||||
}
|
||||
while
|
||||
(1 == 2) {
|
||||
}
|
||||
|
||||
while (true) {
|
||||
}
|
||||
|
||||
while (true){
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -34,7 +34,8 @@ import org.jetbrains.jet.formatter.AbstractJetFormatterTest;
|
||||
@InnerTestClasses({JetFormatterTestGenerated.ModifierList.class})
|
||||
public class JetFormatterTestGenerated extends AbstractJetFormatterTest {
|
||||
public void testAllFilesPresentInFormatter() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/formatter"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests",
|
||||
new File("idea/testData/formatter"), Pattern.compile("^([^\\.]+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("BlockFor.kt")
|
||||
@@ -212,6 +213,11 @@ public class JetFormatterTestGenerated extends AbstractJetFormatterTest {
|
||||
doTest("idea/testData/formatter/WhenLinesBeforeLbrace.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("WhileSpacing.kt")
|
||||
public void testWhileSpacing() throws Exception {
|
||||
doTest("idea/testData/formatter/WhileSpacing.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("idea/testData/formatter/modifierList")
|
||||
public static class ModifierList extends AbstractJetFormatterTest {
|
||||
public void testAllFilesPresentInModifierList() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user