Format spaces after annotation in annotated expression
Fixes #KT-12781
This commit is contained in:
committed by
Nikolay Krasko
parent
ae83330679
commit
db387bd573
@@ -217,6 +217,8 @@ fun createSpacingBuilder(settings: CodeStyleSettings, builderUtil: KotlinSpacing
|
|||||||
after(LONG_TEMPLATE_ENTRY_START).spaces(0)
|
after(LONG_TEMPLATE_ENTRY_START).spaces(0)
|
||||||
before(LONG_TEMPLATE_ENTRY_END).spaces(0)
|
before(LONG_TEMPLATE_ENTRY_END).spaces(0)
|
||||||
|
|
||||||
|
afterInside(ANNOTATION_ENTRY, ANNOTATED_EXPRESSION).spaces(1)
|
||||||
|
|
||||||
val TYPE_COLON_ELEMENTS = TokenSet.create(PROPERTY, FUN, VALUE_PARAMETER, DESTRUCTURING_DECLARATION_ENTRY, FUNCTION_LITERAL)
|
val TYPE_COLON_ELEMENTS = TokenSet.create(PROPERTY, FUN, VALUE_PARAMETER, DESTRUCTURING_DECLARATION_ENTRY, FUNCTION_LITERAL)
|
||||||
beforeInside(COLON, TYPE_COLON_ELEMENTS) { spaceIf(kotlinSettings.SPACE_BEFORE_TYPE_COLON) }
|
beforeInside(COLON, TYPE_COLON_ELEMENTS) { spaceIf(kotlinSettings.SPACE_BEFORE_TYPE_COLON) }
|
||||||
afterInside(COLON, TYPE_COLON_ELEMENTS) { spaceIf(kotlinSettings.SPACE_AFTER_TYPE_COLON) }
|
afterInside(COLON, TYPE_COLON_ELEMENTS) { spaceIf(kotlinSettings.SPACE_AFTER_TYPE_COLON) }
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fun foo() {
|
||||||
|
@Suppress("all") ""
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
fun foo() {
|
||||||
|
@Suppress("all") ""
|
||||||
|
}
|
||||||
@@ -43,6 +43,12 @@ public class FormatterTestGenerated extends AbstractFormatterTest {
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/formatter"), Pattern.compile("^([^\\.]+)\\.after\\.kt.*$"), true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/formatter"), Pattern.compile("^([^\\.]+)\\.after\\.kt.*$"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("AnnotationBeforeExpression.after.kt")
|
||||||
|
public void testAnnotationBeforeExpression() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/AnnotationBeforeExpression.after.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("AnonymousInitializers.after.kt")
|
@TestMetadata("AnonymousInitializers.after.kt")
|
||||||
public void testAnonymousInitializers() throws Exception {
|
public void testAnonymousInitializers() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/AnonymousInitializers.after.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/AnonymousInitializers.after.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user