aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Formats
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-09-27 18:22:49 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-09-27 18:22:49 +0300
commit8422874793845c1bb5234b91f858d74e80c956f7 (patch)
treeca1c366a58ca42edb7bd5397a3072081956fe059 /core/src/main/kotlin/Formats
parent31af10e09963096389a4201ec1b0f8d9a11bb7f6 (diff)
downloaddokka-8422874793845c1bb5234b91f858d74e80c956f7.tar.gz
dokka-8422874793845c1bb5234b91f858d74e80c956f7.tar.bz2
dokka-8422874793845c1bb5234b91f858d74e80c956f7.zip
Render signatures in platform dependent block
Diffstat (limited to 'core/src/main/kotlin/Formats')
-rw-r--r--core/src/main/kotlin/Formats/StructuredFormatService.kt40
1 files changed, 21 insertions, 19 deletions
diff --git a/core/src/main/kotlin/Formats/StructuredFormatService.kt b/core/src/main/kotlin/Formats/StructuredFormatService.kt
index 04710694..162976a6 100644
--- a/core/src/main/kotlin/Formats/StructuredFormatService.kt
+++ b/core/src/main/kotlin/Formats/StructuredFormatService.kt
@@ -362,19 +362,21 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
fun renderSimpleNode(item: DocumentationNode, isSingleNode: Boolean) {
- // TODO: use summarizesignatures
- val rendered = languageService.render(item)
- item.detailOrNull(NodeKind.Signature)?.let {
- if (item.kind !in NodeKind.classLike || !isSingleNode)
- appendAnchor(it.name)
- }
- appendAsSignature(rendered) {
- appendCode { appendContent(rendered) }
- item.appendSourceLink()
- }
- item.appendOverrides()
- item.appendDeprecation()
- item.appendPlatforms()
+ appendAsPlatformDependentBlock(effectivePlatformAndVersion(listOf(item))) { platforms ->
+ // TODO: use summarizesignatures
+ val rendered = languageService.render(item)
+ item.detailOrNull(NodeKind.Signature)?.let {
+ if (item.kind !in NodeKind.classLike || !isSingleNode)
+ appendAnchor(it.name)
+ }
+ appendAsSignature(rendered) {
+ appendCode { appendContent(rendered) }
+ item.appendSourceLink()
+ }
+ item.appendOverrides()
+ item.appendDeprecation()
+ appendPlatforms(platforms)
+ }
}
fun renderGroupNode(item: DocumentationNode, isSingleNode: Boolean) {
@@ -725,6 +727,12 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
nodes
}
+ val platformsToAppend = effectivePlatformAndVersion(nodes)
+ appendAsPlatformDependentBlock(platformsToAppend) {
+ appendContent(summary)
+ appendSoftLineBreak()
+ }
+
val summarySignature = languageService.summarizeSignatures(nodesToAppend)
if (summarySignature != null) {
appendSignatures(summarySignature, nodes, platformsBasedOnMembers, omitSamePlatforms, parentPlatforms)
@@ -736,12 +744,6 @@ abstract class StructuredOutputBuilder(val to: StringBuilder,
appendSignatures(sign, members, platformsBasedOnMembers, omitSamePlatforms, parentPlatforms)
}
}
-
- val platformsToAppend = effectivePlatformAndVersion(nodes)
- appendAsPlatformDependentBlock(platformsToAppend) {
- appendContent(summary)
- appendSoftLineBreak()
- }
}
}