diff options
author | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2017-12-28 19:44:56 +0300 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2018-07-13 18:29:04 +0300 |
commit | e4d3abee285844c002a8984efbae0bf0be23d237 (patch) | |
tree | 611ec9f071c66c7f8b29706435b8edffec388179 /core/src/main/kotlin/Model | |
parent | 63ab561b66974c52a7d13e0823bf94329c0cd7f7 (diff) | |
download | dokka-e4d3abee285844c002a8984efbae0bf0be23d237.tar.gz dokka-e4d3abee285844c002a8984efbae0bf0be23d237.tar.bz2 dokka-e4d3abee285844c002a8984efbae0bf0be23d237.zip |
Build supertypes via Supertype nodes, not reference
Diffstat (limited to 'core/src/main/kotlin/Model')
-rw-r--r-- | core/src/main/kotlin/Model/DocumentationNode.kt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/src/main/kotlin/Model/DocumentationNode.kt b/core/src/main/kotlin/Model/DocumentationNode.kt index 4b108798..813ff0f5 100644 --- a/core/src/main/kotlin/Model/DocumentationNode.kt +++ b/core/src/main/kotlin/Model/DocumentationNode.kt @@ -1,5 +1,6 @@ package org.jetbrains.dokka +import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult import java.util.* enum class NodeKind { @@ -106,10 +107,10 @@ open class DocumentationNode(val name: String, get() = references(RefKind.Platform).map { it.to.name } val supertypes: List<DocumentationNode> - get() = references(RefKind.Superclass).map { it.to } + get() = details(NodeKind.Supertype) val superclass: DocumentationNode? - get() = supertypes.find { it.kind == NodeKind.Class } + get() = supertypes.firstNotNullResult { it.links.firstOrNull { it.kind in NodeKind.classLike } } // TODO: Should we allow node mutation? Model merge will copy by ref, so references are transparent, which could nice fun addReferenceTo(to: DocumentationNode, kind: RefKind) { |