From 23e0d26139a09c7e2e157d1e0099ceab58d9bb48 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Thu, 4 Jun 2020 16:44:25 +0200 Subject: Make enum entry constructor sourceset dependent --- plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt | 6 +++--- .../descriptors/DefaultDescriptorToDocumentableTranslator.kt | 2 +- .../src/main/kotlin/translators/documentables/DefaultPageCreator.kt | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) (limited to 'plugins/base/src/main/kotlin') diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt index 367a7a95..c05dab3c 100644 --- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt +++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt @@ -37,9 +37,9 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog group(styles = setOf(TextStyle.Block)){ annotationsBlock(e) link(e.name, e.dri, styles = emptySet()) - e.extra[ConstructorValues]?.let { - list(it.values, prefix = "(", suffix = ")"){ - text(it) + e.extra[ConstructorValues]?.let { constructorValues -> + platformText(constructorValues.values, constructorValues.values.keys){ + it.joinToString(prefix = "(", postfix = ")") } } } diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index a56eb454..f3b047bc 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -219,7 +219,7 @@ private class DokkaDescriptorVisitor( extra = PropertyContainer.withAll( descriptor.additionalExtras(), descriptor.getAnnotations(), - ConstructorValues(descriptor.getAppliedConstructorParameters()) + ConstructorValues(descriptor.getAppliedConstructorParameters().toSourceSetDependent()) ) ) } diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt index 7f9a8074..1954cec9 100644 --- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt +++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt @@ -141,8 +141,10 @@ open class DefaultPageCreator( protected open fun contentForEnumEntry(e: DEnumEntry) = contentBuilder.contentFor(e) { group(kind = ContentKind.Cover) { header(1, e.name) - +buildSignature(e) - +contentForDescription(e) + sourceSetDependentHint(e.dri, e.sourceSets.toSet()) { + +buildSignature(e) + +contentForDescription(e) + } } group(styles = setOf(ContentStyle.TabbedContent)){ +contentForComments(e) -- cgit