aboutsummaryrefslogtreecommitdiff
path: root/plugins/javadoc/src
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-06-25 12:24:04 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-06-25 14:56:46 +0200
commitdd958697b061a838aeb307de5c96ffa023c2b049 (patch)
tree2295c2ae98b7ae43148e8b34dccef05f45c34da6 /plugins/javadoc/src
parent0b0650079ad5df7965e929cfadc0abe95882c7a9 (diff)
downloaddokka-dd958697b061a838aeb307de5c96ffa023c2b049.tar.gz
dokka-dd958697b061a838aeb307de5c96ffa023c2b049.tar.bz2
dokka-dd958697b061a838aeb307de5c96ffa023c2b049.zip
Javadoc single signature fix
Diffstat (limited to 'plugins/javadoc/src')
-rw-r--r--plugins/javadoc/src/main/kotlin/javadoc/JavadocPageCreator.kt14
1 files changed, 9 insertions, 5 deletions
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<WithConstructors>()?.constructors?.map { it.toJavadocFunction(jvm) }.orEmpty(),
methods = c.functions.map { it.toJavadocFunction(jvm) },
entries = c.safeAs<DEnum>()?.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<ContentNode>.jvmSignature(): ContentNode =
+ first { it.sourceSets.any { it.platform == Platform.jvm } }
+
private fun Documentable.description(sourceSetData: SourceSetData): String =
findNodeInDocumentation<Description>(sourceSetData)