aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/main/kotlin/Formats/StructuredFormatService.kt10
1 files 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()
}