aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Model
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-01-07 01:49:34 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-07-13 18:29:57 +0300
commitbd30fa4c84d749976568be00307297ab015d9b2e (patch)
tree2cac43272cc9da3dcf069adc88ef335cb56303f5 /core/src/main/kotlin/Model
parent87705bf24f6f7e541dbdb14c44e00d0b90a81f37 (diff)
downloaddokka-bd30fa4c84d749976568be00307297ab015d9b2e.tar.gz
dokka-bd30fa4c84d749976568be00307297ab015d9b2e.tar.bz2
dokka-bd30fa4c84d749976568be00307297ab015d9b2e.zip
[backport] Show type parameters substitution in class hierarchy
Original: a06d6a8
Diffstat (limited to 'core/src/main/kotlin/Model')
-rw-r--r--core/src/main/kotlin/Model/DocumentationNode.kt8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/src/main/kotlin/Model/DocumentationNode.kt b/core/src/main/kotlin/Model/DocumentationNode.kt
index 813ff0f5..a145ae8d 100644
--- a/core/src/main/kotlin/Model/DocumentationNode.kt
+++ b/core/src/main/kotlin/Model/DocumentationNode.kt
@@ -1,6 +1,5 @@
package org.jetbrains.dokka
-import org.jetbrains.kotlin.utils.addToStdlib.firstNotNullResult
import java.util.*
enum class NodeKind {
@@ -110,7 +109,7 @@ open class DocumentationNode(val name: String,
get() = details(NodeKind.Supertype)
val superclass: DocumentationNode?
- get() = supertypes.firstNotNullResult { it.links.firstOrNull { it.kind in NodeKind.classLike } }
+ get() = supertypes.firstOrNull { it.links.any { 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) {
@@ -163,7 +162,7 @@ val DocumentationNode.path: List<DocumentationNode>
}
fun DocumentationNode.findOrCreatePackageNode(packageName: String, packageContent: Map<String, Content>, refGraph: NodeReferenceGraph): DocumentationNode {
- val existingNode = members(NodeKind.Package).firstOrNull { it.name == packageName }
+ val existingNode = members(NodeKind.Package).firstOrNull { it.name == packageName }
if (existingNode != null) {
return existingNode
}
@@ -181,7 +180,8 @@ fun DocumentationNode.append(child: DocumentationNode, kind: RefKind) {
RefKind.Detail -> child.addReferenceTo(this, RefKind.Owner)
RefKind.Member -> child.addReferenceTo(this, RefKind.Owner)
RefKind.Owner -> child.addReferenceTo(this, RefKind.Member)
- else -> { /* Do not add any links back for other types */ }
+ else -> { /* Do not add any links back for other types */
+ }
}
}