From dd958697b061a838aeb307de5c96ffa023c2b049 Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Thu, 25 Jun 2020 12:24:04 +0200 Subject: Javadoc single signature fix --- .../javadoc/src/main/kotlin/javadoc/JavadocPageCreator.kt | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'plugins/javadoc') diff --git a/plugins/javadoc/src/main/kotlin/javadoc/JavadocPageCreator.kt b/plugins/javadoc/src/main/kotlin/javadoc/JavadocPageCreator.kt index b4bc19ca..53292225 100644 --- a/plugins/javadoc/src/main/kotlin/javadoc/JavadocPageCreator.kt +++ b/plugins/javadoc/src/main/kotlin/javadoc/JavadocPageCreator.kt @@ -14,6 +14,7 @@ import org.jetbrains.dokka.model.doc.Text import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.model.properties.WithExtraProperties import org.jetbrains.dokka.pages.ContentKind +import org.jetbrains.dokka.pages.ContentNode import org.jetbrains.dokka.pages.DCI import org.jetbrains.dokka.utilities.DokkaLogger import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull @@ -45,20 +46,20 @@ open class JavadocPageCreator( content = contentForClasslike(c), dri = setOf(c.dri), modifiers = listOfNotNull(c.visibility[jvm]?.name), - signature = signatureProvider.signature(c), + signature = signatureProvider.signature(c).jvmSignature(), description = c.description(jvm), constructors = c.safeAs()?.constructors?.map { it.toJavadocFunction(jvm) }.orEmpty(), methods = c.functions.map { it.toJavadocFunction(jvm) }, entries = c.safeAs()?.entries?.map { JavadocEntryNode( - signatureProvider.signature(it), + signatureProvider.signature(it).jvmSignature(), it.description(jvm) ) }.orEmpty(), classlikes = c.classlikes.mapNotNull { pageForClasslike(it) }, properties = c.properties.map { JavadocPropertyNode( - signatureProvider.signature(it), + signatureProvider.signature(it).jvmSignature(), TextNode(it.description(jvm), setOf(jvm)) ) }, @@ -101,7 +102,7 @@ open class JavadocPageCreator( list("Packages", "Package", setOf(p.dri), ContentKind.Packages, p.classlikes.sortedBy { it.name }.map { c -> RowJavadocListEntry( LinkJavadocListEntry(c.name.orEmpty(), setOf(c.dri), JavadocContentKind.Class, sourceSets), - listOf(signatureProvider.signature(c)) + listOf(signatureProvider.signature(c).jvmSignature()) ) }) } @@ -147,7 +148,7 @@ open class JavadocPageCreator( private fun DFunction.toJavadocFunction(sourceSetData: SourceSetData) = JavadocFunctionNode( name = name, - signature = signatureProvider.signature(this), + signature = signatureProvider.signature(this).jvmSignature(), brief = TextNode(description(sourceSetData), setOf(sourceSetData)), parameters = parameters.map { JavadocParameterNode( @@ -159,6 +160,9 @@ open class JavadocPageCreator( extras = extra ) + fun List.jvmSignature(): ContentNode = + first { it.sourceSets.any { it.platform == Platform.jvm } } + private fun Documentable.description(sourceSetData: SourceSetData): String = findNodeInDocumentation(sourceSetData) -- cgit