aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Kotlin/KotlinElementSignatureProvider.kt
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/main/kotlin/Kotlin/KotlinElementSignatureProvider.kt')
-rw-r--r--core/src/main/kotlin/Kotlin/KotlinElementSignatureProvider.kt9
1 files changed, 3 insertions, 6 deletions
diff --git a/core/src/main/kotlin/Kotlin/KotlinElementSignatureProvider.kt b/core/src/main/kotlin/Kotlin/KotlinElementSignatureProvider.kt
index c72dbdda..c7187b23 100644
--- a/core/src/main/kotlin/Kotlin/KotlinElementSignatureProvider.kt
+++ b/core/src/main/kotlin/Kotlin/KotlinElementSignatureProvider.kt
@@ -23,14 +23,11 @@ class KotlinElementSignatureProvider @Inject constructor(
}
-fun PsiElement.extractDescriptor(resolutionFacade: DokkaResolutionFacade): DeclarationDescriptor? {
- val forPsi = this
-
- return when (forPsi) {
+fun PsiElement.extractDescriptor(resolutionFacade: DokkaResolutionFacade): DeclarationDescriptor? =
+ when (val forPsi = this) {
is KtLightClassForFacade -> resolutionFacade.moduleDescriptor.getPackage(forPsi.fqName)
- is KtLightElement<*, *> -> return (forPsi.kotlinOrigin!!).extractDescriptor(resolutionFacade)
+ is KtLightElement<*, *> -> (forPsi.kotlinOrigin!!).extractDescriptor(resolutionFacade)
is PsiPackage -> resolutionFacade.moduleDescriptor.getPackage(FqName(forPsi.qualifiedName))
is PsiMember -> forPsi.getJavaOrKotlinMemberDescriptor(resolutionFacade)
else -> resolutionFacade.resolveSession.bindingContext[BindingContext.DECLARATION_TO_DESCRIPTOR, forPsi]
}
-}