From 0741416fc19add9f83f3754eb99550b3c3578cf9 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Tue, 2 Oct 2018 03:21:11 +0300 Subject: Fix summarizing --- core/src/main/kotlin/Formats/StructuredFormatService.kt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'core/src/main') 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): 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) -- cgit