aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-10-02 03:21:11 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-10-02 03:21:11 +0300
commit0741416fc19add9f83f3754eb99550b3c3578cf9 (patch)
tree48eff1bc4c01857871758141d248e986a1842650
parent25381f71922b8aa665e8c9ceaca58785237cfdba (diff)
downloaddokka-0741416fc19add9f83f3754eb99550b3c3578cf9.tar.gz
dokka-0741416fc19add9f83f3754eb99550b3c3578cf9.tar.bz2
dokka-0741416fc19add9f83f3754eb99550b3c3578cf9.zip
Fix summarizing
-rw-r--r--core/src/main/kotlin/Formats/StructuredFormatService.kt9
1 files changed, 3 insertions, 6 deletions
diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt
index 7e21c30c..eda85031 100644
--- a/core/src/main/kotlin/Formats/StructuredFormatService.kt
+++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt
@@ -765,14 +765,11 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
private fun computeSummarySignatures(items: List<DocumentationNode>): Summarized =
Summarized(items.groupBy { it.summary }.mapValues { (_, nodes) ->
- val nodesToAppend = if (nodes.all { it.kind == NodeKind.GroupNode }) {
- nodes.flatMap { it.origins }
- } else {
- nodes
- }
+ val nodesToAppend = nodes.flatMap { if(it.kind == NodeKind.GroupNode) it.origins else listOf(it) }
+
val summarySignature = languageService.summarizeSignatures(nodesToAppend)
if (summarySignature != null) {
- mapOf(summarySignature to nodes)
+ mapOf(summarySignature to nodesToAppend)
} else {
nodesToAppend.groupBy {
languageService.render(it, RenderMode.SUMMARY)