From 52d3e0e0de74c951651b6f3c9970d0ded7e15e1a Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Tue, 2 Oct 2018 16:19:05 +0300 Subject: Fix platform display for group node overloads --- core/src/main/kotlin/Formats/StructuredFormatService.kt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt index 67e8c503..764fd50e 100644 --- a/core/src/main/kotlin/Formats/StructuredFormatService.kt +++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt @@ -379,11 +379,13 @@ abstract class StructuredOutputBuilder(val to: StringBuilder, } if (item.kind == NodeKind.GroupNode) { - for ((content, origins) in item.origins.groupBy { it.content }) { + val groupByContent = item.origins.groupBy { it.content } + for ((content, origins) in groupByContent) { if (content.isEmpty()) continue - val platforms = effectivePlatformsForMembers(origins) - appendAsPlatformDependentBlock(platforms) { - appendPlatforms(platforms) + appendAsPlatformDependentBlock(effectivePlatformsForMembers(origins)) { platforms -> + if (groupByContent.count { !it.key.isEmpty() } > 1) { + appendPlatforms(platforms) + } appendContent(content.summary) content.appendDescription() } -- cgit