From 86446ac53fc691a5f894e66e0608b67bbf1c3b60 Mon Sep 17 00:00:00 2001 From: Paweł Marks Date: Mon, 4 Nov 2019 13:58:11 +0100 Subject: Adds information about tags to documentation graphs --- core/src/main/kotlin/Utilities/nodeDebug.kt | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'core/src/main/kotlin/Utilities') diff --git a/core/src/main/kotlin/Utilities/nodeDebug.kt b/core/src/main/kotlin/Utilities/nodeDebug.kt index 423e3e5f..c7a771d8 100644 --- a/core/src/main/kotlin/Utilities/nodeDebug.kt +++ b/core/src/main/kotlin/Utilities/nodeDebug.kt @@ -10,15 +10,12 @@ const val LAST = '\u2517' fun DocumentationNode.pretty(prefix: String = "", isLast: Boolean = true): String { val nextPrefix = prefix + (if (isLast) ' ' else DOWN) + ' ' - return prefix + (if (isLast) LAST else BRANCH) + this.toString() + children.dropLast(1).map { - it.pretty( - nextPrefix, - false - ) - }.plus( - children.lastOrNull()?.pretty(nextPrefix) - ).filterNotNull().takeIf { it.isNotEmpty() }?.joinToString( - prefix = "\n", - separator = "" - ).orEmpty() + if (children.isEmpty()) "\n" else "" + return prefix + (if (isLast) LAST else BRANCH) + this.toString() + + children.dropLast(1) + .map { it.pretty(nextPrefix, false) } + .plus(children.lastOrNull()?.pretty(nextPrefix)) + .filterNotNull() + .takeIf { it.isNotEmpty() } + ?.joinToString(prefix = "\n", separator = "") + .orEmpty() + if (children.isEmpty()) "\n" else "" } \ No newline at end of file -- cgit