Skip to content

Commit

Permalink
Add package PSI element to DRI conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Linnea Gräf authored and vmishenev committed Mar 20, 2024
1 parent d7eba91 commit 19d7d13
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 19d7d13

Please sign in to comment.