[Generator] Always put expression body on a new line
This commit is contained in:
committed by
Space Team
parent
68a9b9c312
commit
1c149925b7
@@ -359,12 +359,11 @@ internal class MethodBuilder : AnnotatedAndDocumented(), PrimitiveBuilder {
|
||||
|
||||
fun noBody() { body = null }
|
||||
|
||||
fun String.addAsSingleLineBody(bodyOnNewLine: Boolean = false) {
|
||||
val skip = if (bodyOnNewLine) "$END_LINE " else " "
|
||||
body = " =$skip$this"
|
||||
fun String.setAsExpressionBody() {
|
||||
body = " =$END_LINE $this"
|
||||
}
|
||||
|
||||
fun String.addAsMultiLineBody() {
|
||||
fun String.setAsBlockBody() {
|
||||
body = " {$END_LINE${this.shift()}$END_LINE}"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user