aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-10-03 08:01:20 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-10-03 08:01:20 +0300
commit0370d016c95761b57f13b007cd8c2494601a1539 (patch)
tree3ad614b434a5b76b02c1edd182b54c8f5efe0dea /core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
parent7d4e133fa46b9ab358472398ae03cbefbf49d9e3 (diff)
downloaddokka-0370d016c95761b57f13b007cd8c2494601a1539.tar.gz
dokka-0370d016c95761b57f13b007cd8c2494601a1539.tar.bz2
dokka-0370d016c95761b57f13b007cd8c2494601a1539.zip
Introduce per-pass sinceKotlin
Diffstat (limited to 'core/src/main/kotlin/Kotlin/DocumentationBuilder.kt')
-rw-r--r--core/src/main/kotlin/Kotlin/DocumentationBuilder.kt15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
index d300cf4d..e003c2e7 100644
--- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
+++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
@@ -289,6 +289,11 @@ class DocumentationBuilder
sinceKotlin = kotlinVersion
}
+ fun DocumentationNode.appendDefaultSinceKotlin() {
+ println("setting default sk ${passConfiguration.sinceKotlin} for $this")
+ sinceKotlin = passConfiguration.sinceKotlin
+ }
+
fun DocumentationNode.appendModifiers(descriptor: DeclarationDescriptor) {
val psi = (descriptor as DeclarationDescriptorWithSource).source.getPsi() as? KtModifierListOwner ?: return
appendInline(descriptor, psi)
@@ -590,6 +595,7 @@ class DocumentationBuilder
val node = nodeForDescriptor(this, NodeKind.TypeAlias)
if (!external) {
+ node.appendDefaultSinceKotlin()
node.appendAnnotations(this)
}
node.appendModifiers(this)
@@ -627,6 +633,7 @@ class DocumentationBuilder
for ((descriptor, inheritedLinkKind, extraModifier) in collectMembersToDocument()) {
node.appendClassMember(descriptor, inheritedLinkKind, extraModifier)
}
+ node.appendDefaultSinceKotlin()
node.appendAnnotations(this)
}
node.appendModifiers(this)
@@ -687,6 +694,7 @@ class DocumentationBuilder
val node = nodeForDescriptor(this, NodeKind.Constructor)
node.appendInPageChildren(valueParameters, RefKind.Detail)
node.appendDefaultPlatforms(this)
+ node.appendDefaultSinceKotlin()
register(this, node)
return node
}
@@ -711,6 +719,9 @@ class DocumentationBuilder
extensionReceiverParameter?.let { node.appendChild(it, RefKind.Detail) }
node.appendInPageChildren(valueParameters, RefKind.Detail)
node.appendType(returnType)
+ if (!external) {
+ node.appendDefaultSinceKotlin()
+ }
node.appendAnnotations(this)
node.appendModifiers(this)
if (!external) {
@@ -748,6 +759,9 @@ class DocumentationBuilder
node.appendInPageChildren(typeParameters, RefKind.Detail)
extensionReceiverParameter?.let { node.appendChild(it, RefKind.Detail) }
node.appendType(returnType)
+ if (!external) {
+ node.appendDefaultSinceKotlin()
+ }
node.appendAnnotations(this)
node.appendModifiers(this)
if (!external) {
@@ -817,6 +831,7 @@ class DocumentationBuilder
}
}
}
+ node.appendDefaultSinceKotlin()
node.appendAnnotations(this)
node.appendModifiers(this)
if (varargElementType != null && node.details(NodeKind.Modifier).none { it.name == "vararg" }) {