aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaweł Marks <pmarks@virtuslab.com>2020-02-12 16:01:38 +0100
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-02-18 13:28:23 +0100
commit848f2e0656e80604cb54932db5b250303aaccca8 (patch)
tree2d577faf9ee5f894fb2a97aa01a89d75d3c59841
parent46b4bbb68ce1285a1aea700cc0d0000c6b7ed97b (diff)
downloaddokka-848f2e0656e80604cb54932db5b250303aaccca8.tar.gz
dokka-848f2e0656e80604cb54932db5b250303aaccca8.tar.bz2
dokka-848f2e0656e80604cb54932db5b250303aaccca8.zip
Moves DescriptorToDocumentableTransformer to base plugin
-rw-r--r--core/src/main/kotlin/CoreExtensions.kt1
-rw-r--r--core/src/main/kotlin/DokkaGenerator.kt2
-rw-r--r--core/src/main/kotlin/model/Documentable.kt12
-rw-r--r--core/src/main/kotlin/model/classKinds.kt25
-rw-r--r--core/src/main/kotlin/model/typeWrappers.kt97
-rw-r--r--core/src/main/kotlin/plugability/DefaultExtensions.kt2
-rw-r--r--core/src/main/kotlin/transformers/descriptors/DescriptorToDocumentationTranslator.kt3
-rw-r--r--core/src/main/kotlin/transformers/psi/DefaultPsiToDocumentationTranslator.kt72
-rw-r--r--plugins/base/build.gradle.kts3
-rw-r--r--plugins/base/src/main/kotlin/DokkaBase.kt7
-rw-r--r--plugins/base/src/main/kotlin/transformers/descriptors/DefaultDescriptorToDocumentationTranslator.kt (renamed from core/src/main/kotlin/transformers/descriptors/DefaultDescriptorToDocumentationTranslator.kt)40
-rw-r--r--plugins/kotlin-as-java/build.gradle.kts4
-rw-r--r--plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaDescriptorToDocumentationTranslator.kt13
-rw-r--r--plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageBuilder.kt1
-rw-r--r--plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageContentBuilder.kt2
-rw-r--r--plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPlugin.kt8
-rw-r--r--plugins/kotlin-as-java/src/main/kotlin/KotlinToJVMResolver.kt1
17 files changed, 159 insertions, 134 deletions
diff --git a/core/src/main/kotlin/CoreExtensions.kt b/core/src/main/kotlin/CoreExtensions.kt
index 18cde210..1364f1c1 100644
--- a/core/src/main/kotlin/CoreExtensions.kt
+++ b/core/src/main/kotlin/CoreExtensions.kt
@@ -30,7 +30,6 @@ object CoreExtensions {
val locationProviderFactory by coreExtension<LocationProviderFactory>()
val outputWriter by coreExtension<OutputWriter>()
val renderer by coreExtension<Renderer>()
- val fileExtension by coreExtension<String>()
val pageMergerStrategy by coreExtension<PageMergerStrategy>()
private fun <T: Any> coreExtension() = object {
diff --git a/core/src/main/kotlin/DokkaGenerator.kt b/core/src/main/kotlin/DokkaGenerator.kt
index a31c04a6..6a21e031 100644
--- a/core/src/main/kotlin/DokkaGenerator.kt
+++ b/core/src/main/kotlin/DokkaGenerator.kt
@@ -130,7 +130,7 @@ class DokkaGenerator(
.toList()
return context.single(CoreExtensions.descriptorToDocumentationTranslator)
- .invoke(platformData.name, packageFragments, platformData, context)
+ .invoke(platformData.name, packageFragments, platformData)
}
private fun translatePsi(platformData: PlatformData, context: DokkaContext): Module {
diff --git a/core/src/main/kotlin/model/Documentable.kt b/core/src/main/kotlin/model/Documentable.kt
index e64f82ac..f0820256 100644
--- a/core/src/main/kotlin/model/Documentable.kt
+++ b/core/src/main/kotlin/model/Documentable.kt
@@ -3,9 +3,6 @@ package org.jetbrains.dokka.model
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.doc.DocumentationNode
import org.jetbrains.dokka.pages.PlatformData
-import org.jetbrains.dokka.transformers.descriptors.KotlinClassKindTypes
-import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
-import org.jetbrains.kotlin.descriptors.Visibilities
import org.jetbrains.kotlin.descriptors.Visibility
class Module(override val name: String, val packages: List<Package>) : Documentable() {
@@ -239,15 +236,6 @@ private fun String.shorten(maxLength: Int) = lineSequence().first().let {
if (it.length != length || it.length > maxLength) it.take(maxLength - 3) + "..." else it
}
-interface TypeWrapper {
- val constructorFqName: String?
- val constructorNamePathSegments: List<String>
- val arguments: List<TypeWrapper>
- val dri: DRI?
-}
-
-interface ClassKind
-
fun Documentable.dfs(predicate: (Documentable) -> Boolean): Documentable? =
if (predicate(this)) {
this
diff --git a/core/src/main/kotlin/model/classKinds.kt b/core/src/main/kotlin/model/classKinds.kt
new file mode 100644
index 00000000..2548f68d
--- /dev/null
+++ b/core/src/main/kotlin/model/classKinds.kt
@@ -0,0 +1,25 @@
+package org.jetbrains.dokka.model
+
+import org.jetbrains.dokka.links.DRI
+import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
+import org.jetbrains.kotlin.types.KotlinType
+
+
+interface ClassKind
+
+enum class KotlinClassKindTypes : ClassKind {
+ CLASS,
+ INTERFACE,
+ ENUM_CLASS,
+ ENUM_ENTRY,
+ ANNOTATION_CLASS,
+ OBJECT;
+}
+
+enum class JavaClassKindTypes : ClassKind {
+ CLASS,
+ INTERFACE,
+ ENUM_CLASS,
+ ENUM_ENTRY,
+ ANNOTATION_CLASS;
+}
diff --git a/core/src/main/kotlin/model/typeWrappers.kt b/core/src/main/kotlin/model/typeWrappers.kt
new file mode 100644
index 00000000..5719c6d3
--- /dev/null
+++ b/core/src/main/kotlin/model/typeWrappers.kt
@@ -0,0 +1,97 @@
+package org.jetbrains.dokka.model
+
+import com.intellij.psi.PsiArrayType
+import com.intellij.psi.PsiEllipsisType
+import com.intellij.psi.PsiPrimitiveType
+import com.intellij.psi.PsiType
+import com.intellij.psi.impl.source.PsiClassReferenceType
+import org.jetbrains.dokka.links.DRI
+import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
+import org.jetbrains.kotlin.types.KotlinType
+
+interface TypeWrapper {
+ val constructorFqName: String?
+ val constructorNamePathSegments: List<String>
+ val arguments: List<TypeWrapper>
+ val dri: DRI?
+}
+
+class KotlinTypeWrapper(private val kotlinType: KotlinType) : TypeWrapper {
+ private val declarationDescriptor = kotlinType.constructor.declarationDescriptor
+ private val fqNameSafe = declarationDescriptor?.fqNameSafe
+ override val constructorFqName = fqNameSafe?.asString()
+ override val constructorNamePathSegments: List<String> =
+ fqNameSafe?.pathSegments()?.map { it.asString() } ?: emptyList()
+ override val arguments: List<KotlinTypeWrapper> by lazy {
+ kotlinType.arguments.map {
+ KotlinTypeWrapper(
+ it.type
+ )
+ }
+ }
+ override val dri: DRI? by lazy { declarationDescriptor?.let { DRI.from(it) } }
+}
+
+class JavaTypeWrapper : TypeWrapper {
+
+ override val constructorFqName: String?
+ override val constructorNamePathSegments: List<String>
+ override val arguments: List<TypeWrapper>
+ override val dri: DRI?
+ val isPrimitive: Boolean
+
+ constructor(
+ constructorNamePathSegments: List<String>,
+ arguments: List<TypeWrapper>,
+ dri: DRI?,
+ isPrimitiveType: Boolean
+ ) {
+ this.constructorFqName = constructorNamePathSegments.joinToString(".")
+ this.constructorNamePathSegments = constructorNamePathSegments
+ this.arguments = arguments
+ this.dri = dri
+ this.isPrimitive = isPrimitiveType
+ }
+
+ constructor(type: PsiType) {
+ if (type is PsiClassReferenceType) {
+ val resolved = type.resolve()
+ constructorFqName = resolved?.qualifiedName
+ constructorNamePathSegments = resolved?.qualifiedName?.split('.') ?: emptyList()
+ arguments = type.parameters.mapNotNull {
+ if (it is PsiClassReferenceType) JavaTypeWrapper(it) else null
+ }
+ dri = fromPsi(type)
+ this.isPrimitive = false
+ } else if (type is PsiEllipsisType) {
+ constructorFqName = type.canonicalText
+ constructorNamePathSegments = listOf(type.canonicalText) // TODO
+ arguments = emptyList()
+ dri = DRI("java.lang", "Object") // TODO
+ this.isPrimitive = false
+ } else if (type is PsiArrayType) {
+ constructorFqName = type.canonicalText
+ constructorNamePathSegments = listOf(type.canonicalText)
+ arguments = emptyList()
+ dri = (type as? PsiClassReferenceType)?.let { fromPsi(it) } // TODO
+ this.isPrimitive = false
+ } else {
+ type as PsiPrimitiveType
+ constructorFqName = type.name
+ constructorNamePathSegments = type.name.split('.')
+ arguments = emptyList()
+ dri = null
+ this.isPrimitive = true
+ }
+ }
+
+ private fun fromPsi(type: PsiClassReferenceType): DRI {
+ val className = type.className
+ val pkg = type.canonicalText.removeSuffix(className).removeSuffix(".")
+ return DRI(packageName = pkg, classNames = className)
+ }
+
+ override fun toString(): String {
+ return constructorFqName.orEmpty()
+ }
+}
diff --git a/core/src/main/kotlin/plugability/DefaultExtensions.kt b/core/src/main/kotlin/plugability/DefaultExtensions.kt
index 1320c282..70a7e4db 100644
--- a/core/src/main/kotlin/plugability/DefaultExtensions.kt
+++ b/core/src/main/kotlin/plugability/DefaultExtensions.kt
@@ -6,7 +6,6 @@ import org.jetbrains.dokka.renderers.FileWriter
import org.jetbrains.dokka.renderers.OutputWriter
import org.jetbrains.dokka.renderers.html.HtmlRenderer
import org.jetbrains.dokka.resolvers.DefaultLocationProviderFactory
-import org.jetbrains.dokka.transformers.descriptors.DefaultDescriptorToDocumentationTranslator
import org.jetbrains.dokka.transformers.documentation.DefaultDocumentationNodeMerger
import org.jetbrains.dokka.transformers.documentation.DefaultDocumentationToPageTranslator
import org.jetbrains.dokka.transformers.pages.DefaultPageMergerStrategy
@@ -28,7 +27,6 @@ internal object DefaultExtensions {
@Suppress("IMPLICIT_CAST_TO_ANY", "UNCHECKED_CAST")
internal fun <T : Any, E : ExtensionPoint<T>> get(point: E, fullContext: DokkaContext): List<T> =
when (point) {
- CoreExtensions.descriptorToDocumentationTranslator -> DefaultDescriptorToDocumentationTranslator
CoreExtensions.psiToDocumentationTranslator -> DefaultPsiToDocumentationTranslator
CoreExtensions.documentationMerger -> DefaultDocumentationNodeMerger
CoreExtensions.commentsToContentConverter -> converter.get(fullContext)
diff --git a/core/src/main/kotlin/transformers/descriptors/DescriptorToDocumentationTranslator.kt b/core/src/main/kotlin/transformers/descriptors/DescriptorToDocumentationTranslator.kt
index 61d636d6..5074833e 100644
--- a/core/src/main/kotlin/transformers/descriptors/DescriptorToDocumentationTranslator.kt
+++ b/core/src/main/kotlin/transformers/descriptors/DescriptorToDocumentationTranslator.kt
@@ -9,7 +9,6 @@ interface DescriptorToDocumentationTranslator {
fun invoke(
moduleName: String,
packageFragments: Iterable<PackageFragmentDescriptor>,
- platformData: PlatformData,
- context: DokkaContext
+ platformData: PlatformData
): Module
} \ No newline at end of file
diff --git a/core/src/main/kotlin/transformers/psi/DefaultPsiToDocumentationTranslator.kt b/core/src/main/kotlin/transformers/psi/DefaultPsiToDocumentationTranslator.kt
index 144f319f..055df0b2 100644
--- a/core/src/main/kotlin/transformers/psi/DefaultPsiToDocumentationTranslator.kt
+++ b/core/src/main/kotlin/transformers/psi/DefaultPsiToDocumentationTranslator.kt
@@ -141,75 +141,3 @@ object DefaultPsiToDocumentationTranslator : PsiToDocumentationTranslator {
}
}
}
-
-enum class JavaClassKindTypes : ClassKind {
- CLASS,
- INTERFACE,
- ENUM_CLASS,
- ENUM_ENTRY,
- ANNOTATION_CLASS;
-}
-
-class JavaTypeWrapper : TypeWrapper {
-
- override val constructorFqName: String?
- override val constructorNamePathSegments: List<String>
- override val arguments: List<TypeWrapper>
- override val dri: DRI?
- val isPrimitive: Boolean
-
- constructor(
- constructorNamePathSegments: List<String>,
- arguments: List<TypeWrapper>,
- dri: DRI?,
- isPrimitiveType: Boolean
- ) {
- this.constructorFqName = constructorNamePathSegments.joinToString(".")
- this.constructorNamePathSegments = constructorNamePathSegments
- this.arguments = arguments
- this.dri = dri
- this.isPrimitive = isPrimitiveType
- }
-
- constructor(type: PsiType) {
- if (type is PsiClassReferenceType) {
- val resolved = type.resolve()
- constructorFqName = resolved?.qualifiedName
- constructorNamePathSegments = resolved?.qualifiedName?.split('.') ?: emptyList()
- arguments = type.parameters.mapNotNull {
- if (it is PsiClassReferenceType) JavaTypeWrapper(it) else null
- }
- dri = fromPsi(type)
- this.isPrimitive = false
- } else if (type is PsiEllipsisType) {
- constructorFqName = type.canonicalText
- constructorNamePathSegments = listOf(type.canonicalText) // TODO
- arguments = emptyList()
- dri = DRI("java.lang", "Object") // TODO
- this.isPrimitive = false
- } else if (type is PsiArrayType) {
- constructorFqName = type.canonicalText
- constructorNamePathSegments = listOf(type.canonicalText)
- arguments = emptyList()
- dri = (type as? PsiClassReferenceType)?.let { fromPsi(it) } // TODO
- this.isPrimitive = false
- } else {
- type as PsiPrimitiveType
- constructorFqName = type.name
- constructorNamePathSegments = type.name.split('.')
- arguments = emptyList()
- dri = null
- this.isPrimitive = true
- }
- }
-
- private fun fromPsi(type: PsiClassReferenceType): DRI {
- val className = type.className
- val pkg = type.canonicalText.removeSuffix(className).removeSuffix(".")
- return DRI(packageName = pkg, classNames = className)
- }
-
- override fun toString(): String {
- return constructorFqName.orEmpty()
- }
-} \ No newline at end of file
diff --git a/plugins/base/build.gradle.kts b/plugins/base/build.gradle.kts
index 386a3288..ba0b5753 100644
--- a/plugins/base/build.gradle.kts
+++ b/plugins/base/build.gradle.kts
@@ -5,4 +5,5 @@ publishing {
from(components["java"])
}
}
-} \ No newline at end of file
+}
+
diff --git a/plugins/base/src/main/kotlin/DokkaBase.kt b/plugins/base/src/main/kotlin/DokkaBase.kt
index e82a59bf..5c579e54 100644
--- a/plugins/base/src/main/kotlin/DokkaBase.kt
+++ b/plugins/base/src/main/kotlin/DokkaBase.kt
@@ -1,4 +1,11 @@
+package org.jetbrains.dokka.base
+
+import org.jetbrains.dokka.CoreExtensions
+import org.jetbrains.dokka.base.transformers.descriptors.DefaultDescriptorToDocumentationTranslator
import org.jetbrains.dokka.plugability.DokkaPlugin
class DokkaBase: DokkaPlugin() {
+ val defaultDescriptorToDocumentationTranslator by extending {
+ CoreExtensions.descriptorToDocumentationTranslator providing ::DefaultDescriptorToDocumentationTranslator
+ }
} \ No newline at end of file
diff --git a/core/src/main/kotlin/transformers/descriptors/DefaultDescriptorToDocumentationTranslator.kt b/plugins/base/src/main/kotlin/transformers/descriptors/DefaultDescriptorToDocumentationTranslator.kt
index 173e13ac..1358cef1 100644
--- a/core/src/main/kotlin/transformers/descriptors/DefaultDescriptorToDocumentationTranslator.kt
+++ b/plugins/base/src/main/kotlin/transformers/descriptors/DefaultDescriptorToDocumentationTranslator.kt
@@ -1,4 +1,4 @@
-package org.jetbrains.dokka.transformers.descriptors
+package org.jetbrains.dokka.base.transformers.descriptors
import org.jetbrains.dokka.analysis.DokkaResolutionFacade
import org.jetbrains.dokka.links.Callable
@@ -13,6 +13,7 @@ import org.jetbrains.dokka.model.doc.*
import org.jetbrains.dokka.pages.PlatformData
import org.jetbrains.dokka.parsers.MarkdownParser
import org.jetbrains.dokka.plugability.DokkaContext
+import org.jetbrains.dokka.transformers.descriptors.DescriptorToDocumentationTranslator
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorVisitorEmptyBodies
import org.jetbrains.kotlin.idea.kdoc.findKDoc
@@ -24,12 +25,13 @@ import org.jetbrains.kotlin.resolve.scopes.MemberScope
import org.jetbrains.kotlin.types.KotlinType
import kotlin.reflect.KClass
-object DefaultDescriptorToDocumentationTranslator : DescriptorToDocumentationTranslator {
+class DefaultDescriptorToDocumentationTranslator(
+ private val context: DokkaContext
+) : DescriptorToDocumentationTranslator {
override fun invoke(
moduleName: String,
packageFragments: Iterable<PackageFragmentDescriptor>,
- platformData: PlatformData,
- context: DokkaContext
+ platformData: PlatformData
) = DokkaDescriptorVisitor(platformData, context.platforms[platformData]?.facade!!).run {
packageFragments.map {
visitPackageFragmentDescriptor(
@@ -50,7 +52,7 @@ data class DRIWithPlatformInfo(
fun DRI.withEmptyInfo() = DRIWithPlatformInfo(this, null, emptyList())
-open class DokkaDescriptorVisitor(
+open class DokkaDescriptorVisitor( // TODO: close this class and make it private together with DRIWithPlatformInfo
private val platformData: PlatformData,
private val resolutionFacade: DokkaResolutionFacade
) : DeclarationDescriptorVisitorEmptyBodies<Documentable, DRIWithPlatformInfo>() {
@@ -302,7 +304,7 @@ open class DokkaDescriptorVisitor(
private fun DeclarationDescriptor.resolveDescriptorData(): PlatformInfo {
val doc = findKDoc()
- val parser: MarkdownParser = MarkdownParser(resolutionFacade, this)
+ val parser = MarkdownParser(resolutionFacade, this)
val docHeader = parser.parseFromKDocTag(doc)
return BasePlatformInfo(docHeader, listOf(platformData))
@@ -334,29 +336,3 @@ open class DokkaDescriptorVisitor(
this.map { it.filterTagWrappers(types, name)!! }
}
-data class XMLMega(val key: String, val dri: DRI) : Extra
-
-enum class KotlinClassKindTypes : ClassKind {
- CLASS,
- INTERFACE,
- ENUM_CLASS,
- ENUM_ENTRY,
- ANNOTATION_CLASS,
- OBJECT;
-}
-
-class KotlinTypeWrapper(private val kotlinType: KotlinType) : TypeWrapper {
- private val declarationDescriptor = kotlinType.constructor.declarationDescriptor
- private val fqNameSafe = declarationDescriptor?.fqNameSafe
- override val constructorFqName = fqNameSafe?.asString()
- override val constructorNamePathSegments: List<String> =
- fqNameSafe?.pathSegments()?.map { it.asString() } ?: emptyList()
- override val arguments: List<KotlinTypeWrapper> by lazy {
- kotlinType.arguments.map {
- KotlinTypeWrapper(
- it.type
- )
- }
- }
- override val dri: DRI? by lazy { declarationDescriptor?.let { DRI.from(it) } }
-} \ No newline at end of file
diff --git a/plugins/kotlin-as-java/build.gradle.kts b/plugins/kotlin-as-java/build.gradle.kts
index 3b281d53..32f9c931 100644
--- a/plugins/kotlin-as-java/build.gradle.kts
+++ b/plugins/kotlin-as-java/build.gradle.kts
@@ -5,4 +5,8 @@ publishing {
from(components["java"])
}
}
+}
+
+dependencies {
+ implementation(project(":plugins:base"))
} \ No newline at end of file
diff --git a/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaDescriptorToDocumentationTranslator.kt b/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaDescriptorToDocumentationTranslator.kt
index 9c4ee9aa..1edf4aa1 100644
--- a/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaDescriptorToDocumentationTranslator.kt
+++ b/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaDescriptorToDocumentationTranslator.kt
@@ -1,6 +1,9 @@
package org.jetbrains.dokka.kotlinAsJava
import org.jetbrains.dokka.analysis.DokkaResolutionFacade
+import org.jetbrains.dokka.base.transformers.descriptors.DRIWithPlatformInfo
+import org.jetbrains.dokka.base.transformers.descriptors.DokkaDescriptorVisitor
+import org.jetbrains.dokka.base.transformers.descriptors.withEmptyInfo
import org.jetbrains.dokka.links.Callable
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.links.withClass
@@ -8,18 +11,16 @@ import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.model.Function
import org.jetbrains.dokka.pages.PlatformData
import org.jetbrains.dokka.plugability.DokkaContext
-import org.jetbrains.dokka.transformers.descriptors.DRIWithPlatformInfo
import org.jetbrains.dokka.transformers.descriptors.DescriptorToDocumentationTranslator
-import org.jetbrains.dokka.transformers.descriptors.DokkaDescriptorVisitor
-import org.jetbrains.dokka.transformers.descriptors.withEmptyInfo
import org.jetbrains.kotlin.descriptors.*
-object KotlinAsJavaDescriptorToDocumentationTranslator : DescriptorToDocumentationTranslator {
+class KotlinAsJavaDescriptorToDocumentationTranslator(
+ private val context: DokkaContext
+) : DescriptorToDocumentationTranslator {
override fun invoke(
moduleName: String,
packageFragments: Iterable<PackageFragmentDescriptor>,
- platformData: PlatformData,
- context: DokkaContext
+ platformData: PlatformData
): Module =
KotlinAsJavaDokkaDescriptorVisitor(platformData, context.platforms[platformData]?.facade!!).run {
packageFragments.map { visitPackageFragmentDescriptor(it, DRI.topLevel.withEmptyInfo()) }
diff --git a/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageBuilder.kt b/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageBuilder.kt
index 8f026477..6fe10ce1 100644
--- a/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageBuilder.kt
+++ b/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageBuilder.kt
@@ -9,7 +9,6 @@ import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.model.Enum
import org.jetbrains.dokka.model.Function
import org.jetbrains.dokka.pages.*
-import org.jetbrains.dokka.transformers.descriptors.KotlinClassKindTypes
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.Visibilities
import org.jetbrains.kotlin.js.resolve.diagnostics.findPsi
diff --git a/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageContentBuilder.kt b/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageContentBuilder.kt
index 05896d11..a5d0bd33 100644
--- a/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageContentBuilder.kt
+++ b/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPageContentBuilder.kt
@@ -2,8 +2,8 @@ package org.jetbrains.dokka.kotlinAsJava
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.Function
+import org.jetbrains.dokka.model.JavaTypeWrapper
import org.jetbrains.dokka.pages.*
-import org.jetbrains.dokka.transformers.psi.JavaTypeWrapper
import org.jetbrains.dokka.utilities.DokkaLogger
class KotlinAsJavaPageContentBuilder(
diff --git a/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPlugin.kt b/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPlugin.kt
index 345dc9be..e99e0843 100644
--- a/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPlugin.kt
+++ b/plugins/kotlin-as-java/src/main/kotlin/KotlinAsJavaPlugin.kt
@@ -12,8 +12,12 @@ import org.jetbrains.dokka.transformers.documentation.DocumentationToPageTransla
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
class KotlinAsJavaPlugin : DokkaPlugin() {
- val kotlinAsJavaDescriptorToDocumentableTranslator by extending { CoreExtensions.descriptorToDocumentationTranslator with KotlinAsJavaDescriptorToDocumentationTranslator }
- val kotlinAsJavaDocumentableToPageTranslator by extending { CoreExtensions.documentationToPageTranslator with KotlinAsJavaDocumentationToPageTranslator }
+ val kotlinAsJavaDescriptorToDocumentableTranslator by extending {
+ CoreExtensions.descriptorToDocumentationTranslator providing ::KotlinAsJavaDescriptorToDocumentationTranslator
+ }
+ val kotlinAsJavaDocumentableToPageTranslator by extending {
+ CoreExtensions.documentationToPageTranslator with KotlinAsJavaDocumentationToPageTranslator
+ }
}
object DescriptorCache {
diff --git a/plugins/kotlin-as-java/src/main/kotlin/KotlinToJVMResolver.kt b/plugins/kotlin-as-java/src/main/kotlin/KotlinToJVMResolver.kt
index 87a173f3..7b0495e9 100644
--- a/plugins/kotlin-as-java/src/main/kotlin/KotlinToJVMResolver.kt
+++ b/plugins/kotlin-as-java/src/main/kotlin/KotlinToJVMResolver.kt
@@ -5,7 +5,6 @@ import org.jetbrains.dokka.links.*
import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.model.Function
import org.jetbrains.dokka.model.Enum
-import org.jetbrains.dokka.transformers.psi.JavaTypeWrapper
import org.jetbrains.kotlin.builtins.jvm.JavaToKotlinClassMap
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.PropertyDescriptor