Format spaces around by keyword (#1016)
This commit is contained in:
committed by
Dmitry Jemerov
parent
238eaf0d0e
commit
ffe80dd549
@@ -251,6 +251,9 @@ fun createSpacingBuilder(settings: CodeStyleSettings, builderUtil: KotlinSpacing
|
|||||||
betweenInside(TYPE_ARGUMENT_LIST, LAMBDA_ARGUMENT, CALL_EXPRESSION).spaces(1)
|
betweenInside(TYPE_ARGUMENT_LIST, LAMBDA_ARGUMENT, CALL_EXPRESSION).spaces(1)
|
||||||
|
|
||||||
between(WHEN_ENTRY, WHEN_ENTRY).lineBreakInCode()
|
between(WHEN_ENTRY, WHEN_ENTRY).lineBreakInCode()
|
||||||
|
|
||||||
|
around(BY_KEYWORD).spaces(1)
|
||||||
|
betweenInside(IDENTIFIER, PROPERTY_DELEGATE, PROPERTY).spaces(1)
|
||||||
}
|
}
|
||||||
custom {
|
custom {
|
||||||
|
|
||||||
|
|||||||
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
class Bar(val r: Runnable) : Runnable by r
|
||||||
|
class Foo {
|
||||||
|
val bar by lazy { "" }
|
||||||
|
}
|
||||||
Vendored
+4
@@ -0,0 +1,4 @@
|
|||||||
|
class Bar(val r: Runnable) : Runnable by r
|
||||||
|
class Foo {
|
||||||
|
val bar by lazy { "" }
|
||||||
|
}
|
||||||
@@ -98,6 +98,12 @@ public class FormatterTestGenerated extends AbstractFormatterTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("By.after.kt")
|
||||||
|
public void testBy() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/By.after.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("Cast.after.kt")
|
@TestMetadata("Cast.after.kt")
|
||||||
public void testCast() throws Exception {
|
public void testCast() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/Cast.after.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/Cast.after.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user