[Generator] Rename additionalDoc, put its content before annotations

This commit is contained in:
Ilya Gorbunov
2023-08-28 21:20:38 +02:00
committed by Space Team
parent cd392ebe69
commit 60bbd08569
6 changed files with 12 additions and 12 deletions
+7 -7
View File
@@ -40,7 +40,7 @@ internal interface PrimitiveBuilder {
internal abstract class AnnotatedAndDocumented {
private var doc: String? = null
val annotations: MutableList<String> = mutableListOf()
var additionalDoc: String? = null
var additionalComments: String? = null
fun appendDoc(doc: String) {
if (this.doc == null) {
@@ -55,15 +55,15 @@ internal abstract class AnnotatedAndDocumented {
appendLine(doc!!.printAsDoc(forceMultiLineDoc))
}
if (annotations.isNotEmpty()) {
appendLine(annotations.joinToString(separator = END_LINE) { "@$it" })
}
if (additionalDoc != null) {
additionalDoc!!.lines().forEach { line ->
if (additionalComments != null) {
additionalComments!!.lines().forEach { line ->
appendLine("// $line")
}
}
if (annotations.isNotEmpty()) {
appendLine(annotations.joinToString(separator = END_LINE) { "@$it" })
}
}
private fun String.printAsDoc(forceMultiLine: Boolean = false): String {