aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin/DocumentationBuilder.kt
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-02-06 16:10:04 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-02-06 16:10:04 +0100
commit0e76eed8d9fee675542d35f525ff9e8ab6408857 (patch)
treea41b330421b453786b789ff53f5316d64c89b293 /src/Kotlin/DocumentationBuilder.kt
parent4ed5b2ec786b0f67405e5db81be2a2d9f4b6e591 (diff)
downloaddokka-0e76eed8d9fee675542d35f525ff9e8ab6408857.tar.gz
dokka-0e76eed8d9fee675542d35f525ff9e8ab6408857.tar.bz2
dokka-0e76eed8d9fee675542d35f525ff9e8ab6408857.zip
use getResolutionScope() from plugin; use simpler way to resolve descriptor in scope; rename @code tag to @sample
Diffstat (limited to 'src/Kotlin/DocumentationBuilder.kt')
-rw-r--r--src/Kotlin/DocumentationBuilder.kt6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index 041b7617..1b37dc51 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -51,7 +51,7 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati
if (kdoc is KDocSection) {
val tags = kdoc.getTags()
tags.forEach {
- if (it.getName() == "code") {
+ if (it.getName() == "sample") {
content.append(functionBody(descriptor, it.getContent()))
} else {
val section = content.addSection(displayName(it.getName()), it.getSubjectName())
@@ -529,7 +529,7 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati
}
}
- fun getResolutionScope(node: DocumentationNode): DeclarationDescriptor {
+ fun getDescriptorForNode(node: DocumentationNode): DeclarationDescriptor {
val descriptor = nodeToDescriptor[node] ?: throw IllegalArgumentException("Node is not known to this context")
return descriptor
}
@@ -543,7 +543,7 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati
private fun resolveContentLink(node: DocumentationNode, content: ContentNode): ContentNode {
if (content is ContentExternalLink) {
val referenceText = content.href
- val symbols = resolveKDocLink(session, getResolutionScope(node), null, referenceText.split('.').toList())
+ val symbols = resolveKDocLink(session, getDescriptorForNode(node), null, referenceText.split('.').toList())
// don't include unresolved links in generated doc
// assume that if an href doesn't contain '/', it's not an attempt to reference an external file
if (symbols.isNotEmpty() || "/" !in referenceText) {