aboutsummaryrefslogtreecommitdiff
path: root/src/Formats/StructuredFormatService.kt
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-10-14 19:53:13 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-10-14 19:53:13 +0400
commit4907736abf96bf04b8e23a6772f0411936cb2008 (patch)
treee9194669ddd74ca5978dfbac9120832652f5fb89 /src/Formats/StructuredFormatService.kt
parent92b82525ebb969cbd0706a6322ec7bace4628800 (diff)
downloaddokka-4907736abf96bf04b8e23a6772f0411936cb2008.tar.gz
dokka-4907736abf96bf04b8e23a6772f0411936cb2008.tar.bz2
dokka-4907736abf96bf04b8e23a6772f0411936cb2008.zip
Sort members into groups, filter accessors
Diffstat (limited to 'src/Formats/StructuredFormatService.kt')
-rw-r--r--src/Formats/StructuredFormatService.kt29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/Formats/StructuredFormatService.kt b/src/Formats/StructuredFormatService.kt
index 280aa6b5..740f6b6a 100644
--- a/src/Formats/StructuredFormatService.kt
+++ b/src/Formats/StructuredFormatService.kt
@@ -81,7 +81,7 @@ public abstract class StructuredFormatService(val locationService: LocationServi
if (!single) {
appendBlockCode(to, formatText(location, languageService.render(node)))
}
- appendLine(to, formatText(location,node.content.description))
+ appendLine(to, formatText(location, node.content.description))
appendLine(to)
for ((label, section) in node.content.sections) {
if (label.startsWith("$"))
@@ -118,7 +118,7 @@ public abstract class StructuredFormatService(val locationService: LocationServi
}
}
- private fun StructuredFormatService.appendSection(location : Location, caption: String, nodes: List<DocumentationNode>, node: DocumentationNode, to: StringBuilder) {
+ private fun StructuredFormatService.appendSection(location: Location, caption: String, nodes: List<DocumentationNode>, node: DocumentationNode, to: StringBuilder) {
if (nodes.any()) {
appendHeader(to, caption, 3)
@@ -163,7 +163,30 @@ public abstract class StructuredFormatService(val locationService: LocationServi
}
for (node in nodes) {
- appendSection(location, "Members", node.members, node, to)
+ appendSection(location, "Packages", node.members(DocumentationNode.Kind.Package), node, to)
+ appendSection(location, "Types", node.members.filter {
+ it.kind in setOf(
+ DocumentationNode.Kind.Class,
+ DocumentationNode.Kind.Interface,
+ DocumentationNode.Kind.Enum,
+ DocumentationNode.Kind.Object)
+ }, node, to)
+ appendSection(location, "Constructors", node.members(DocumentationNode.Kind.Constructor), node, to)
+ appendSection(location, "Properties", node.members(DocumentationNode.Kind.Property), node, to)
+ appendSection(location, "Functions", node.members(DocumentationNode.Kind.Function), node, to)
+ appendSection(location, "Accessors", node.members(DocumentationNode.Kind.PropertyAccessor), node, to)
+ appendSection(location, "Other members", node.members.filter {
+ it.kind !in setOf(
+ DocumentationNode.Kind.Class,
+ DocumentationNode.Kind.Interface,
+ DocumentationNode.Kind.Object,
+ DocumentationNode.Kind.Constructor,
+ DocumentationNode.Kind.Property,
+ DocumentationNode.Kind.Package,
+ DocumentationNode.Kind.Function,
+ DocumentationNode.Kind.PropertyAccessor
+ )
+ }, node, to)
appendSection(location, "Extensions", node.extensions, node, to)
appendSection(location, "Inheritors", node.inheritors, node, to)
appendSection(location, "Links", node.links, node, to)