mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-26 15:51:48 +00:00
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)
|
||||
|
||||
between(WHEN_ENTRY, WHEN_ENTRY).lineBreakInCode()
|
||||
|
||||
around(BY_KEYWORD).spaces(1)
|
||||
betweenInside(IDENTIFIER, PROPERTY_DELEGATE, PROPERTY).spaces(1)
|
||||
}
|
||||
custom {
|
||||
|
||||
|
||||
4
idea/testData/formatter/By.after.kt
vendored
Normal file
4
idea/testData/formatter/By.after.kt
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
class Bar(val r: Runnable) : Runnable by r
|
||||
class Foo {
|
||||
val bar by lazy { "" }
|
||||
}
|
||||
4
idea/testData/formatter/By.kt
vendored
Normal file
4
idea/testData/formatter/By.kt
vendored
Normal file
@@ -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);
|
||||
}
|
||||
|
||||
@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")
|
||||
public void testCast() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/formatter/Cast.after.kt");
|
||||
|
||||
Reference in New Issue
Block a user