[Generator] Always put expression body on a new line

This commit is contained in:
Ilya Gorbunov
2023-08-29 04:43:07 +02:00
committed by Space Team
parent 68a9b9c312
commit 1c149925b7
13 changed files with 463 additions and 277 deletions
+3 -4
View File
@@ -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}"
}
}