aboutsummaryrefslogtreecommitdiff
path: root/plugins/kotlin-as-java/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/kotlin-as-java/src/main')
-rw-r--r--plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageContentBuilder.kt1
-rw-r--r--plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPlugin.kt16
2 files changed, 11 insertions, 6 deletions
diff --git a/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageContentBuilder.kt b/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageContentBuilder.kt
index 02e6ff82..87649a83 100644
--- a/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageContentBuilder.kt
+++ b/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageContentBuilder.kt
@@ -3,6 +3,7 @@ package org.jetbrains.dokka.kotlinAsJava
import org.jetbrains.dokka.base.transformers.documentables.DefaultPageContentBuilder
import org.jetbrains.dokka.base.transformers.documentables.PageContentBuilderFunction
import org.jetbrains.dokka.base.transformers.documentables.type
+import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.Function
import org.jetbrains.dokka.model.JavaTypeWrapper
diff --git a/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPlugin.kt b/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPlugin.kt
index f8a25aca..f9389ebd 100644
--- a/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPlugin.kt
+++ b/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPlugin.kt
@@ -2,12 +2,14 @@ package org.jetbrains.dokka.kotlinAsJava
import org.jetbrains.dokka.CoreExtensions
+import org.jetbrains.dokka.base.DokkaBase
+import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentConverter
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.Module
import org.jetbrains.dokka.pages.ModulePageNode
-import org.jetbrains.dokka.plugability.DokkaContext
-import org.jetbrains.dokka.plugability.DokkaPlugin
+import org.jetbrains.dokka.plugability.*
import org.jetbrains.dokka.transformers.documentation.DocumentablesToPageTranslator
+import org.jetbrains.dokka.utilities.DokkaLogger
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
class KotlinAsJavaPlugin : DokkaPlugin() {
@@ -15,7 +17,7 @@ class KotlinAsJavaPlugin : DokkaPlugin() {
CoreExtensions.descriptorToDocumentationTranslator providing ::KotlinAsJavaDescriptorToDocumentationTranslator
}
val kotlinAsJavaDocumentableToPageTranslator by extending {
- CoreExtensions.documentablesToPageTranslator with KotlinAsJavaDocumentationToPageTranslator
+ CoreExtensions.documentablesToPageTranslator providing ::KotlinAsJavaDocumentationToPageTranslator
}
}
@@ -26,14 +28,16 @@ object DescriptorCache {
operator fun get(dri: DRI): DeclarationDescriptor? = cache[dri]
}
-object KotlinAsJavaDocumentationToPageTranslator : DocumentablesToPageTranslator {
- override fun invoke(module: Module, context: DokkaContext): ModulePageNode =
+class KotlinAsJavaDocumentationToPageTranslator(
+ private val context: DokkaContext
+) : DocumentablesToPageTranslator {
+ override fun invoke(module: Module): ModulePageNode =
KotlinAsJavaPageBuilder { node, kind, operation ->
KotlinAsJavaPageContentBuilder.group(
setOf(node.dri),
node.platformData,
kind,
- context.single(CoreExtensions.commentsToContentConverter),
+ context.plugin<DokkaBase>().querySingle { commentsToContentConverter },
context.logger,
operation
)