diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2017-02-23 16:35:45 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2017-02-23 16:35:45 +0100 |
commit | 99689adee954582da57268ff0375fdec52193a01 (patch) | |
tree | 82b41b04e568a564ba91473e1dcaba25b611a2b6 /core/src/main/kotlin/Model | |
parent | a39c7a161282d132d08bcf89eed0213374a574e9 (diff) | |
download | dokka-99689adee954582da57268ff0375fdec52193a01.tar.gz dokka-99689adee954582da57268ff0375fdec52193a01.tar.bz2 dokka-99689adee954582da57268ff0375fdec52193a01.zip |
Merge declarations with the same signature defined for multiple platforms
Diffstat (limited to 'core/src/main/kotlin/Model')
-rw-r--r-- | core/src/main/kotlin/Model/DocumentationNode.kt | 1 | ||||
-rw-r--r-- | core/src/main/kotlin/Model/DocumentationReference.kt | 9 |
2 files changed, 5 insertions, 5 deletions
diff --git a/core/src/main/kotlin/Model/DocumentationNode.kt b/core/src/main/kotlin/Model/DocumentationNode.kt index 56c295cd..caacac14 100644 --- a/core/src/main/kotlin/Model/DocumentationNode.kt +++ b/core/src/main/kotlin/Model/DocumentationNode.kt @@ -138,6 +138,7 @@ open class DocumentationNode(val name: String, class DocumentationModule(name: String, content: Content = Content.Empty) : DocumentationNode(name, content, NodeKind.Module) { + val nodeRefGraph = NodeReferenceGraph() } val DocumentationNode.path: List<DocumentationNode> diff --git a/core/src/main/kotlin/Model/DocumentationReference.kt b/core/src/main/kotlin/Model/DocumentationReference.kt index 4f28d7c3..a968f400 100644 --- a/core/src/main/kotlin/Model/DocumentationReference.kt +++ b/core/src/main/kotlin/Model/DocumentationReference.kt @@ -1,6 +1,5 @@ package org.jetbrains.dokka -import com.google.inject.Inject import com.google.inject.Singleton enum class RefKind { @@ -37,9 +36,7 @@ class PendingDocumentationReference(val lazyNodeFrom: () -> DocumentationNode?, } } -@Singleton -class NodeReferenceGraph - @Inject constructor(val logger: DokkaLogger) { +class NodeReferenceGraph() { private val nodeMap = hashMapOf<String, DocumentationNode>() val references = arrayListOf<PendingDocumentationReference>() @@ -59,7 +56,9 @@ class NodeReferenceGraph references.add(PendingDocumentationReference({ -> nodeMap[fromSignature]}, { -> nodeMap[toSignature]}, kind)) } - fun lookup(signature: String): DocumentationNode? { + fun lookup(signature: String) = nodeMap[signature] + + fun lookupOrWarn(signature: String, logger: DokkaLogger): DocumentationNode? { val result = nodeMap[signature] if (result == null) { logger.warn("Can't find node by signature $signature") |