[FIR generator] Print builder property name in generated classes' KDocs

Just like we do when generating the IR tree
This commit is contained in:
Sergej Jaskiewicz
2023-10-19 12:14:48 +02:00
committed by Space Team
parent fa20e401f8
commit 9eacdb3314
164 changed files with 502 additions and 22 deletions
@@ -16,6 +16,11 @@ abstract class AbstractElement<Element, Field> : ElementOrRef<Element, Field>, F
abstract val name: String
/**
* The fully-qualified name of the property in the tree generator that is used to configure this element.
*/
abstract val propertyName: String
abstract val kDoc: String?
abstract val fields: Set<Field>
@@ -67,3 +67,12 @@ fun SmartPrinter.printKDoc(kDoc: String?) {
}
println(" */")
}
fun AbstractElement<*, *>.extendedKDoc(defaultKDoc: String? = null): String = buildString {
val doc = kDoc ?: defaultKDoc
if (doc != null) {
appendLine(doc)
appendLine()
}
append("Generated from: [${element.propertyName}]")
}