aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/src/main/kotlin/links/DRI.kt9
-rw-r--r--core/src/main/kotlin/pages/PageBuilder.kt2
-rw-r--r--core/src/main/kotlin/resolvers/DefaultLocationProvider.kt2
-rw-r--r--core/src/main/kotlin/transformers/documentation/DefaultDocumentationNodeMerger.kt9
4 files changed, 14 insertions, 8 deletions
diff --git a/core/src/main/kotlin/links/DRI.kt b/core/src/main/kotlin/links/DRI.kt
index 0bce22eb..0aeba264 100644
--- a/core/src/main/kotlin/links/DRI.kt
+++ b/core/src/main/kotlin/links/DRI.kt
@@ -94,10 +94,11 @@ data class TypeReference(val classNames: String, val typeBounds: List<TypeRefere
TypeReference("", tp.upperBounds.map { from(it) })
private fun from(t: KotlinType): TypeReference =
- when (val d = t.constructor.declarationDescriptor) {
- is TypeParameterDescriptor -> TypeReference("todo:${d.name}")
- else -> TypeReference(t.constructorName.orEmpty(), t.arguments.map { from(it) })
- }
+ TypeReference(t.constructorName.orEmpty(), t.arguments.map { from(it) })
+// when (val d = t.constructor.declarationDescriptor) {
+// is TypeParameterDescriptor -> TypeReference("todo:${d.name}")
+// else -> TypeReference(t.constructorName.orEmpty(), t.arguments.map { from(it) })
+// }
private fun from(t: TypeProjection): TypeReference =
if (t.isStarProjection) {
diff --git a/core/src/main/kotlin/pages/PageBuilder.kt b/core/src/main/kotlin/pages/PageBuilder.kt
index 9c40f73e..b32e4f4f 100644
--- a/core/src/main/kotlin/pages/PageBuilder.kt
+++ b/core/src/main/kotlin/pages/PageBuilder.kt
@@ -9,7 +9,7 @@ class DefaultPageBuilder(
) : PageBuilder {
override fun pageForModule(m: Module): ModulePageNode =
- ModulePageNode(m.name ?: "root", contentForModule(m), m, m.packages.map { pageForPackage(it) })
+ ModulePageNode(m.name.ifEmpty { "root" }, contentForModule(m), m, m.packages.map { pageForPackage(it) })
override fun pageForPackage(p: Package) =
PackagePageNode(p.name, contentForPackage(p), p.dri, p,
diff --git a/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt b/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt
index 0020b18d..7442f449 100644
--- a/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt
+++ b/core/src/main/kotlin/resolvers/DefaultLocationProvider.kt
@@ -50,7 +50,7 @@ open class DefaultLocationProvider(
fun getPath(pathNode: PageNode?, path: List<String> = mutableListOf()): List<String> = when (pathNode) {
null -> path
- else -> getPath(pathNode.parent(), path + pathNode.pathName())
+ else -> getPath(pathNode.parent(), path + pathNode.pathName().ifEmpty { "root" })
}
val contextNode = if (context?.children?.isEmpty() == true) context.parent() else context
diff --git a/core/src/main/kotlin/transformers/documentation/DefaultDocumentationNodeMerger.kt b/core/src/main/kotlin/transformers/documentation/DefaultDocumentationNodeMerger.kt
index fe689c01..626038f5 100644
--- a/core/src/main/kotlin/transformers/documentation/DefaultDocumentationNodeMerger.kt
+++ b/core/src/main/kotlin/transformers/documentation/DefaultDocumentationNodeMerger.kt
@@ -1,18 +1,23 @@
package org.jetbrains.dokka.transformers.documentation
+import com.intellij.openapi.diagnostic.logger
import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.model.Function
import org.jetbrains.dokka.plugability.DokkaContext
+import org.jetbrains.dokka.utilities.DokkaConsoleLogger
internal object DefaultDocumentationNodeMerger : DocumentationNodeMerger {
- override fun invoke(modules: Collection<Module>, context: DokkaContext): Module =
- Module(
+ override fun invoke(modules: Collection<Module>, context: DokkaContext): Module {
+ if (!modules.drop(1).all { it.name == modules.first().name })
+ DokkaConsoleLogger.error("All module names need to be the same")
+ return Module(
modules.first().name,
merge(
modules.flatMap { it.packages },
Package::mergeWith
)
)
+ }
}
private fun <T: Documentable> merge(elements: List<T>, reducer: (T, T) -> T): List<T> =