aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Formats
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2016-01-12 19:37:31 +0100
committerDmitry Jemerov <yole@jetbrains.com>2016-01-12 19:37:31 +0100
commit6cccf161648881e7285694a6b0893b73abbde9fb (patch)
treed1f06745c98b1174ce7b7864521e8fa9dfe87982 /core/src/main/kotlin/Formats
parent8640e513391f3a3c9909396d45795543f01e87d2 (diff)
downloaddokka-6cccf161648881e7285694a6b0893b73abbde9fb.tar.gz
dokka-6cccf161648881e7285694a6b0893b73abbde9fb.tar.bz2
dokka-6cccf161648881e7285694a6b0893b73abbde9fb.zip
don't sort enum values alphabetically (https://github.com/Kotlin/dokka/issues/47)
Diffstat (limited to 'core/src/main/kotlin/Formats')
-rw-r--r--core/src/main/kotlin/Formats/StructuredFormatService.kt6
1 files changed, 3 insertions, 3 deletions
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<DocumentationNode>) {
+ private fun appendSection(caption: String, members: List<DocumentationNode>, 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) {