From 6cccf161648881e7285694a6b0893b73abbde9fb Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Tue, 12 Jan 2016 19:37:31 +0100 Subject: don't sort enum values alphabetically (https://github.com/Kotlin/dokka/issues/47) --- core/src/main/kotlin/Formats/StructuredFormatService.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/src') diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt index c9218c46..85b7d3c1 100644 --- a/core/src/main/kotlin/Formats/StructuredFormatService.kt +++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt @@ -299,7 +299,7 @@ abstract class StructuredFormatService(locationService: LocationService, appendSection("Annotations", node.members(NodeKind.AnnotationClass)) appendSection("Exceptions", node.members(NodeKind.Exception)) appendSection("Extensions for External Classes", node.members(NodeKind.ExternalClass)) - appendSection("Enum Values", node.members(NodeKind.EnumItem)) + appendSection("Enum Values", node.members(NodeKind.EnumItem), sortMembers = false) appendSection("Constructors", node.members(NodeKind.Constructor)) appendSection("Properties", node.members(NodeKind.Property)) appendSection("Inherited Properties", node.inheritedMembers(NodeKind.Property)) @@ -345,12 +345,12 @@ abstract class StructuredFormatService(locationService: LocationService, } } - private fun appendSection(caption: String, members: List) { + private fun appendSection(caption: String, members: List, sortMembers: Boolean = true) { if (members.isEmpty()) return appendHeader(to, caption, 3) - val children = members.sortedBy { it.name } + val children = if (sortMembers) members.sortedBy { it.name } else members val membersMap = children.groupBy { link(node, it) } appendTable(to) { -- cgit