From 36ac5bfe78e581d4a2f4877c71543c097ebe4993 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Thu, 23 Nov 2023 16:26:21 +0100 Subject: Add package declaration descriptor to DRI conversion --- .../analysis/kotlin/descriptors/compiler/configuration/DRIFactory.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dokka-subprojects/analysis-kotlin-descriptors-compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/DRIFactory.kt b/dokka-subprojects/analysis-kotlin-descriptors-compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/DRIFactory.kt index e2deaa8c..7d6bbc7c 100644 --- a/dokka-subprojects/analysis-kotlin-descriptors-compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/DRIFactory.kt +++ b/dokka-subprojects/analysis-kotlin-descriptors-compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/configuration/DRIFactory.kt @@ -13,6 +13,11 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.parentsWithSelf import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull internal fun DRI.Companion.from(descriptor: DeclarationDescriptor) = descriptor.parentsWithSelf.run { + if (descriptor is PackageViewDescriptor) { + return@run DRI( + packageName = descriptor.fqName.asString() + ) + } val parameter = firstIsInstanceOrNull() val callable = parameter?.containingDeclaration ?: firstIsInstanceOrNull() -- cgit