aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2023-11-23 16:20:42 +0100
committerLinnea Gräf <nea@nea.moe>2023-11-23 16:20:42 +0100
commitb3789633e95d39bca20e1c545114325eee2cab4d (patch)
treebef44c2d99bbfa9a952530fee374878435ccaf2b
parent99aa026845cc08ea23b6f900697b6bb45084da69 (diff)
downloaddokka-b3789633e95d39bca20e1c545114325eee2cab4d.tar.gz
dokka-b3789633e95d39bca20e1c545114325eee2cab4d.tar.bz2
dokka-b3789633e95d39bca20e1c545114325eee2cab4d.zip
Add package PSI element to DRI conversion
-rw-r--r--dokka-subprojects/analysis-java-psi/src/main/kotlin/org/jetbrains/dokka/analysis/java/util/PsiUtil.kt5
1 files changed, 5 insertions, 0 deletions
diff --git a/dokka-subprojects/analysis-java-psi/src/main/kotlin/org/jetbrains/dokka/analysis/java/util/PsiUtil.kt b/dokka-subprojects/analysis-java-psi/src/main/kotlin/org/jetbrains/dokka/analysis/java/util/PsiUtil.kt
index 162f940e..5eb44174 100644
--- a/dokka-subprojects/analysis-java-psi/src/main/kotlin/org/jetbrains/dokka/analysis/java/util/PsiUtil.kt
+++ b/dokka-subprojects/analysis-java-psi/src/main/kotlin/org/jetbrains/dokka/analysis/java/util/PsiUtil.kt
@@ -18,6 +18,11 @@ internal val PsiElement.parentsWithSelf: Sequence<PsiElement>
@InternalDokkaApi
public fun DRI.Companion.from(psi: PsiElement): DRI = psi.parentsWithSelf.run {
+ if (psi is PsiPackage) {
+ return@run DRI(
+ packageName = psi.qualifiedName,
+ )
+ }
val psiMethod = firstIsInstanceOrNull<PsiMethod>()
val psiField = firstIsInstanceOrNull<PsiField>()
val classes = filterIsInstance<PsiClass>().filterNot { it is PsiTypeParameter }