aboutsummaryrefslogtreecommitdiff
path: root/plugins/kotlin-as-java/src/main/kotlin
diff options
context:
space:
mode:
authorPaweł Marks <pmarks@virtuslab.com>2020-02-17 11:27:37 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-02-18 13:28:23 +0100
commitba769f0695aaa9719b62ca32028fd3d24442f5ec (patch)
tree5f7ed51c2eaae6988648d5132ff8d5aa258c5bc5 /plugins/kotlin-as-java/src/main/kotlin
parent2bfb7733dfef8da0271a01a7275ea42ecb69d93a (diff)
downloaddokka-ba769f0695aaa9719b62ca32028fd3d24442f5ec.tar.gz
dokka-ba769f0695aaa9719b62ca32028fd3d24442f5ec.tar.bz2
dokka-ba769f0695aaa9719b62ca32028fd3d24442f5ec.zip
Moves comments to content conversion to base plugin
Diffstat (limited to 'plugins/kotlin-as-java/src/main/kotlin')
-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
)