From 8c218ff4dd5f970233c43845c19299fc74256389 Mon Sep 17 00:00:00 2001 From: Ignat Beresnev Date: Fri, 29 Apr 2022 15:03:08 +0300 Subject: Enable warnings as errors and fix all warnings (#2451) * Enable warnings as errors and fix all warnings * Enable skip-metadata-version-check compiler setting --- .../kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt | 11 +++++++---- .../org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt | 7 ++++--- .../jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt | 4 +++- 3 files changed, 14 insertions(+), 8 deletions(-) (limited to 'plugins/javadoc/src/main') diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt index 61d45ae1..a79c6b20 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/JavadocPageCreator.kt @@ -37,9 +37,12 @@ open class JavadocPageCreator(context: DokkaContext) { p.classlikes.mapNotNull { pageForClasslike(it) } ) - fun pageForClasslike(c: DClasslike): JavadocClasslikePageNode? = - c.highestJvmSourceSet?.let { jvm -> + fun pageForClasslike(c: DClasslike): JavadocClasslikePageNode? { + return c.highestJvmSourceSet?.let { jvm -> + @Suppress("UNCHECKED_CAST") + val extra = ((c as? WithExtraProperties)?.extra ?: PropertyContainer.empty()) val children = c.classlikes.mapNotNull { pageForClasslike(it) } + JavadocClasslikePageNode( name = c.dri.classNames.orEmpty(), content = contentForClasslike(c), @@ -70,10 +73,10 @@ open class JavadocPageCreator(context: DokkaContext) { }, documentables = listOf(c), children = children, - extra = ((c as? WithExtraProperties)?.extra - ?: PropertyContainer.empty()) + c.indexesInDocumentation() + extra = extra + c.indexesInDocumentation() ) } + } private fun contentForModule(m: DModule): JavadocContentNode = JavadocContentGroup( diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt index bef4108c..057b9e85 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/pages/htmlPreprocessors.kt @@ -39,12 +39,13 @@ object TreeViewInstaller : PageTransformer { root = root ) - return node.modified(children = node.children.map { node -> + val nodeChildren = node.children.map { childNode -> install( - node, + childNode, root ) - } + overviewTree) as JavadocModulePageNode + } + return node.modified(children = nodeChildren + overviewTree) as JavadocModulePageNode } private fun installPackageTreeNode(node: JavadocPackagePageNode, root: RootPageNode): JavadocPackagePageNode { diff --git a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt index 1d721611..f8377e41 100644 --- a/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt +++ b/plugins/javadoc/src/main/kotlin/org/jetbrains/dokka/javadoc/renderer/KorteJavadocRenderer.kt @@ -11,7 +11,6 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.runBlocking import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.OutputWriter -import org.jetbrains.dokka.base.resolvers.local.LocationProvider import org.jetbrains.dokka.javadoc.JavadocPlugin import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.pages.* @@ -136,7 +135,9 @@ class KorteJavadocRenderer(val context: DokkaContext, resourceDir: String) : ) }, TeFunction("createPackageHierarchy") { args -> + @Suppress("UNCHECKED_CAST") val list = args.first() as List + list.mapIndexed { i, p -> val content = if (i + 1 == list.size) "" else ", " val name = p.name @@ -144,6 +145,7 @@ class KorteJavadocRenderer(val context: DokkaContext, resourceDir: String) : }.joinToString("\n") }, TeFunction("renderInheritanceGraph") { args -> + @Suppress("UNCHECKED_CAST") val rootNodes = args.first() as List fun drawRec(node: TreeViewPage.InheritanceNode): String = -- cgit