[formatter] line indent provider: fix indent for empty braces

^KT-42411 Fixed
This commit is contained in:
Dmitry Gridin
2020-10-02 19:49:15 +07:00
parent 380226cba0
commit 3078bd7b67
21 changed files with 247 additions and 50 deletions
@@ -93,16 +93,6 @@ public class PerformanceTypingIndentationTestGenerated extends AbstractPerforman
runTest("idea/testData/indentationOnNewline/ConsecutiveCallsInSafeCallsEnd.kt");
}
@TestMetadata("FunctionBlock.kt")
public void testFunctionBlock() throws Exception {
runTest("idea/testData/indentationOnNewline/FunctionBlock.kt");
}
@TestMetadata("FunctionBlock2.kt")
public void testFunctionBlock2() throws Exception {
runTest("idea/testData/indentationOnNewline/FunctionBlock2.kt");
}
@TestMetadata("HigherOrderFunction.kt")
public void testHigherOrderFunction() throws Exception {
runTest("idea/testData/indentationOnNewline/HigherOrderFunction.kt");
@@ -567,6 +557,64 @@ public class PerformanceTypingIndentationTestGenerated extends AbstractPerforman
}
}
@TestMetadata("idea/testData/indentationOnNewline/emptyBraces")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class EmptyBraces extends AbstractPerformanceTypingIndentationTest {
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doPerfTest, this, testDataFilePath);
}
public void testAllFilesPresentInEmptyBraces() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/indentationOnNewline/emptyBraces"), Pattern.compile("^([^.]+)\\.(kt|kts)$"), null, true);
}
@TestMetadata("ClassWithConstructor.kt")
public void testClassWithConstructor() throws Exception {
runTest("idea/testData/indentationOnNewline/emptyBraces/ClassWithConstructor.kt");
}
@TestMetadata("ClassWithConstructor2.kt")
public void testClassWithConstructor2() throws Exception {
runTest("idea/testData/indentationOnNewline/emptyBraces/ClassWithConstructor2.kt");
}
@TestMetadata("ClassWithoutConstructor.kt")
public void testClassWithoutConstructor() throws Exception {
runTest("idea/testData/indentationOnNewline/emptyBraces/ClassWithoutConstructor.kt");
}
@TestMetadata("FunctionBlock.kt")
public void testFunctionBlock() throws Exception {
runTest("idea/testData/indentationOnNewline/emptyBraces/FunctionBlock.kt");
}
@TestMetadata("FunctionBlock2.kt")
public void testFunctionBlock2() throws Exception {
runTest("idea/testData/indentationOnNewline/emptyBraces/FunctionBlock2.kt");
}
@TestMetadata("FunctionBody3.kt")
public void testFunctionBody3() throws Exception {
runTest("idea/testData/indentationOnNewline/emptyBraces/FunctionBody3.kt");
}
@TestMetadata("FunctionBody4.kt")
public void testFunctionBody4() throws Exception {
runTest("idea/testData/indentationOnNewline/emptyBraces/FunctionBody4.kt");
}
@TestMetadata("FunctionBodyInsideClass.kt")
public void testFunctionBodyInsideClass() throws Exception {
runTest("idea/testData/indentationOnNewline/emptyBraces/FunctionBodyInsideClass.kt");
}
@TestMetadata("FunctionBodyInsideClass2.kt")
public void testFunctionBodyInsideClass2() throws Exception {
runTest("idea/testData/indentationOnNewline/emptyBraces/FunctionBodyInsideClass2.kt");
}
}
@TestMetadata("idea/testData/indentationOnNewline/emptyParameters")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)