aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/signatures
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/main/kotlin/signatures')
-rw-r--r--plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt15
1 files changed, 10 insertions, 5 deletions
diff --git a/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt b/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt
index 0ae72109..0cf085b8 100644
--- a/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt
+++ b/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt
@@ -15,8 +15,8 @@ interface JvmSignatureUtils {
fun Set<ExtraModifiers>.toSignatureString(): String =
joinToString("") { it.name.toLowerCase() + " " }
- fun <T : Documentable> WithExtraProperties<T>.annotations(): List<Annotations.Annotation> =
- extra[Annotations]?.content ?: emptyList()
+ fun <T : Documentable> WithExtraProperties<T>.annotations(): SourceSetDependent<List<Annotations.Annotation>> =
+ extra[Annotations]?.content ?: emptyMap()
private fun Annotations.Annotation.toSignatureString(): String =
"@" + this.dri.classNames + "(" + this.params.entries.joinToString { it.key + "=" + it.value } + ")"
@@ -24,7 +24,7 @@ interface JvmSignatureUtils {
private fun PageContentBuilder.DocumentableContentBuilder.annotations(
d: Documentable,
ignored: Set<Annotations.Annotation>,
- operation: (Annotations.Annotation) -> Unit
+ operation: PageContentBuilder.DocumentableContentBuilder.(Annotations.Annotation) -> Unit
): Unit = when (d) {
is DFunction -> d.annotations()
is DProperty -> d.annotations()
@@ -39,8 +39,12 @@ interface JvmSignatureUtils {
is DParameter -> d.annotations()
else -> null
}?.let {
- it.filter { it !in ignored }.forEach {
- operation(it)
+ it.entries.forEach {
+ group(sourceSets = setOf(it.key)) {
+ it.value.filter { it !in ignored }.forEach {
+ operation(it)
+ }
+ }
}
} ?: Unit
@@ -50,6 +54,7 @@ interface JvmSignatureUtils {
listBrackets: Pair<Char, Char>,
classExtension: String
) {
+
when (renderAtStrategy) {
is All, is OnlyOnce -> text("@")
is Never -> Unit