Adjust formatting for FILE_ANNOTATION_LIST
This commit is contained in:
@@ -84,6 +84,9 @@ fun createSpacingBuilder(settings: CodeStyleSettings): KotlinSpacingBuilder {
|
|||||||
|
|
||||||
simple {
|
simple {
|
||||||
// ============ Line breaks ==============
|
// ============ Line breaks ==============
|
||||||
|
before(FILE_ANNOTATION_LIST).lineBreakInCode()
|
||||||
|
after(FILE_ANNOTATION_LIST).blankLines(1)
|
||||||
|
|
||||||
after(PACKAGE_DIRECTIVE).blankLines(1)
|
after(PACKAGE_DIRECTIVE).blankLines(1)
|
||||||
between(IMPORT_DIRECTIVE, IMPORT_DIRECTIVE).lineBreakInCode()
|
between(IMPORT_DIRECTIVE, IMPORT_DIRECTIVE).lineBreakInCode()
|
||||||
after(IMPORT_LIST).blankLines(1)
|
after(IMPORT_LIST).blankLines(1)
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
/*
|
||||||
|
* Comment
|
||||||
|
*/
|
||||||
|
@file:Some("Hi")
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
/*
|
||||||
|
* Comment
|
||||||
|
*/ @file:Some("Hi")
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
@file:Some()
|
||||||
|
|
||||||
|
val test = 1
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
@file:Some() val test = 1
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
@file:Some()
|
||||||
|
|
||||||
|
import hi
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
@file:Some() import hi
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
@file:Some()
|
||||||
|
|
||||||
|
package test
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
@file:Some() package test
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
@file:Some()
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
@file:Some()
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@file:Some()
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@file:Some()
|
||||||
@@ -565,6 +565,51 @@ public class FormatterTestGenerated extends AbstractFormatterTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("idea/testData/formatter/fileAnnotations")
|
||||||
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
public static class FileAnnotations extends AbstractFormatterTest {
|
||||||
|
@TestMetadata("afterComment.after.kt")
|
||||||
|
public void testAfterComment() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/fileAnnotations/afterComment.after.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testAllFilesPresentInFileAnnotations() throws Exception {
|
||||||
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/formatter/fileAnnotations"), Pattern.compile("^([^\\.]+)\\.after\\.kt.*$"), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("beforeDeclaration.after.kt")
|
||||||
|
public void testBeforeDeclaration() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/fileAnnotations/beforeDeclaration.after.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("beforeImportList.after.kt")
|
||||||
|
public void testBeforeImportList() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/fileAnnotations/beforeImportList.after.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("beforePackage.after.kt")
|
||||||
|
public void testBeforePackage() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/fileAnnotations/beforePackage.after.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inEmptyFile.after.kt")
|
||||||
|
public void testInEmptyFile() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/fileAnnotations/inEmptyFile.after.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("manyLinesFromFileBegin.after.kt")
|
||||||
|
public void testManyLinesFromFileBegin() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/fileAnnotations/manyLinesFromFileBegin.after.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("idea/testData/formatter/modifierList")
|
@TestMetadata("idea/testData/formatter/modifierList")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
|
|||||||
Reference in New Issue
Block a user