[FIR generator] Print builder property name in generated classes' KDocs
Just like we do when generating the IR tree
This commit is contained in:
committed by
Space Team
parent
fa20e401f8
commit
9eacdb3314
+5
@@ -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>
|
||||
|
||||
+9
@@ -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}]")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user