diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-01-14 13:30:43 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-01-14 13:30:43 +0100 |
commit | 0dd5ea3c1492b15bd386ec5c2c8d6e467a8f72a9 (patch) | |
tree | 0804f2730bd7da28cfb063f1b00fb4cc1773c4f9 /src/Formats | |
parent | cd21e1fea43c0b7fa8013e3db7f49fe2b600b7f8 (diff) | |
download | dokka-0dd5ea3c1492b15bd386ec5c2c8d6e467a8f72a9.tar.gz dokka-0dd5ea3c1492b15bd386ec5c2c8d6e467a8f72a9.tar.bz2 dokka-0dd5ea3c1492b15bd386ec5c2c8d6e467a8f72a9.zip |
link overriding functions to the corresponding base class functions
Diffstat (limited to 'src/Formats')
-rw-r--r-- | src/Formats/StructuredFormatService.kt | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/src/Formats/StructuredFormatService.kt b/src/Formats/StructuredFormatService.kt index 3f505e37..bfb69d1d 100644 --- a/src/Formats/StructuredFormatService.kt +++ b/src/Formats/StructuredFormatService.kt @@ -119,23 +119,35 @@ public abstract class StructuredFormatService(val locationService: LocationServi for ((summary, items) in breakdownBySummary) { items.forEach { appendBlockCode(to, formatText(location, languageService.render(it))) - val deprecation = it.deprecation - if (deprecation != null) { - val deprecationParameter = deprecation.details(DocumentationNode.Kind.Parameter).firstOrNull() - val deprecationValue = deprecationParameter?.details(DocumentationNode.Kind.Value)?.firstOrNull() - if (deprecationValue != null) { - to.append(formatStrong("Deprecated: ")) - appendLine(to, formatText(deprecationValue.name.trim("\""))) - } else { - appendLine(to, formatStrong("Deprecated")) - } - } + it.appendOverrides(to) + it.appendDeprecation(to) } appendLine(to, summary) appendLine(to) } } + private fun DocumentationNode.appendOverrides(to: StringBuilder) { + overrides.forEach { + to.append("Overrides ") + val location = locationService.relativeLocation(this, it, extension) + appendLine(to, formatLink(FormatLink(it.owner!!.name + "." + it.name, location))) + } + } + + private fun DocumentationNode.appendDeprecation(to: StringBuilder) { + if (deprecation != null) { + val deprecationParameter = deprecation!!.details(DocumentationNode.Kind.Parameter).firstOrNull() + val deprecationValue = deprecationParameter?.details(DocumentationNode.Kind.Value)?.firstOrNull() + if (deprecationValue != null) { + to.append(formatStrong("Deprecated: ")) + appendLine(to, formatText(deprecationValue.name.trim("\""))) + } else { + appendLine(to, formatStrong("Deprecated")) + } + } + } + fun appendLocation(location: Location, to: StringBuilder, nodes: Iterable<DocumentationNode>) { val breakdownByName = nodes.groupBy { node -> node.name } for ((name, items) in breakdownByName) { |