aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/transformers
diff options
context:
space:
mode:
authorMarcin Aman <marcin.aman@gmail.com>2021-07-28 18:23:50 +0200
committerGitHub <noreply@github.com>2021-07-28 18:23:50 +0200
commitb2b542988d1523749ab3a881e3cd4cf502ccdd6d (patch)
tree5a68f6ada1df4c31ffad0597bb6b952f4791a407 /plugins/base/src/main/kotlin/transformers
parentf03083d7534209ad94dc3c4d7afd17f58e58127d (diff)
downloaddokka-b2b542988d1523749ab3a881e3cd4cf502ccdd6d.tar.gz
dokka-b2b542988d1523749ab3a881e3cd4cf502ccdd6d.tar.bz2
dokka-b2b542988d1523749ab3a881e3cd4cf502ccdd6d.zip
Fix broken link in kotlinx.serialization (#2038)
* Fix broken link in kotlinx.serialization * Rename DRIWithSourceSet to DRIWithSourceSets
Diffstat (limited to 'plugins/base/src/main/kotlin/transformers')
-rw-r--r--plugins/base/src/main/kotlin/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/base/src/main/kotlin/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt b/plugins/base/src/main/kotlin/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt
index 4eacf359..2fb70fc8 100644
--- a/plugins/base/src/main/kotlin/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt
+++ b/plugins/base/src/main/kotlin/transformers/pages/merger/SameMethodNamePageMergerStrategy.kt
@@ -1,5 +1,7 @@
package org.jetbrains.dokka.base.transformers.pages.merger
+import org.jetbrains.dokka.base.renderers.sourceSets
+import org.jetbrains.dokka.model.DisplaySourceSet
import org.jetbrains.dokka.model.dfs
import org.jetbrains.dokka.pages.*
import org.jetbrains.dokka.utilities.DokkaLogger
@@ -19,7 +21,7 @@ class SameMethodNamePageMergerStrategy(val logger: DokkaLogger) : PageMergerStra
dri = dri,
name = name,
children = members.flatMap { it.children }.distinct(),
- content = squashDivergentInstances(members),
+ content = squashDivergentInstances(members).withSourceSets(members.allSourceSets()),
embeddedResources = members.flatMap { it.embeddedResources }.distinct(),
documentable = null
)
@@ -27,6 +29,9 @@ class SameMethodNamePageMergerStrategy(val logger: DokkaLogger) : PageMergerStra
return (pages - members) + listOf(merged)
}
+ private fun List<MemberPageNode>.allSourceSets(): Set<DisplaySourceSet> =
+ fold(emptySet()) { acc, e -> acc + e.sourceSets() }
+
private fun squashDivergentInstances(nodes: List<MemberPageNode>): ContentNode =
nodes.map { it.content }
.reduce { acc, node ->