From 49d69219c9e3cf6307c5be161dc56d04e217d668 Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Tue, 7 Apr 2020 16:40:05 +0200 Subject: Resolves problems with multiple DRI resolve in Markdown Parser --- .../descriptors/DefaultDescriptorToDocumentableTranslator.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins/base/src') diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index b7dfccd2..0e24fc08 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -11,6 +11,7 @@ import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.parsers.MarkdownParser import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.descriptors.DescriptorToDocumentableTranslator +import org.jetbrains.dokka.utilities.DokkaLogger import org.jetbrains.kotlin.builtins.isExtensionFunctionType import org.jetbrains.kotlin.builtins.isFunctionType import org.jetbrains.kotlin.codegen.isJvmStaticInObjectOrClassOrInterface @@ -40,7 +41,7 @@ class DefaultDescriptorToDocumentableTranslator( moduleName: String, packageFragments: Iterable, platformData: PlatformData - ) = DokkaDescriptorVisitor(platformData, context.platforms.getValue(platformData).facade).run { + ) = DokkaDescriptorVisitor(platformData, context.platforms.getValue(platformData).facade, context.logger).run { packageFragments.map { visitPackageFragmentDescriptor( it, @@ -60,7 +61,8 @@ fun DRI.withEmptyInfo() = DRIWithPlatformInfo(this, PlatformDependent.empty()) private class DokkaDescriptorVisitor( private val platformData: PlatformData, - private val resolutionFacade: DokkaResolutionFacade + private val resolutionFacade: DokkaResolutionFacade, + private val logger: DokkaLogger ) : DeclarationDescriptorVisitorEmptyBodies() { override fun visitDeclarationDescriptor(descriptor: DeclarationDescriptor, parent: DRIWithPlatformInfo): Nothing { throw IllegalStateException("${javaClass.simpleName} should never enter ${descriptor.javaClass.simpleName}") @@ -514,7 +516,7 @@ private class DokkaDescriptorVisitor( toBound().let { if (isMarkedNullable) Nullable(it) else it } private fun DeclarationDescriptor.getDocumentation() = findKDoc().let { - MarkdownParser(resolutionFacade, this).parseFromKDocTag(it) + MarkdownParser(resolutionFacade, this, logger).parseFromKDocTag(it) } private fun ClassDescriptor.companion(dri: DRIWithPlatformInfo): DObject? = companionObjectDescriptor?.let { -- cgit