diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-06-15 15:17:27 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-06-25 14:56:46 +0200 |
commit | b2ab395be8cb1560088987aa5132d3782596fc80 (patch) | |
tree | 0285437d287e49e43ce8d403072814581587866f /plugins/base/src/main/kotlin/translators | |
parent | d96d46f76ed800de45cade90dedc11ec72a37341 (diff) | |
download | dokka-b2ab395be8cb1560088987aa5132d3782596fc80.tar.gz dokka-b2ab395be8cb1560088987aa5132d3782596fc80.tar.bz2 dokka-b2ab395be8cb1560088987aa5132d3782596fc80.zip |
Fix tests
Diffstat (limited to 'plugins/base/src/main/kotlin/translators')
-rw-r--r-- | plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index 18a1dc3c..f3102b2d 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -421,7 +421,7 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { private fun PsiAnnotationMemberValue.toValue(): AnnotationParameterValue? = when (this) { is PsiAnnotation -> toAnnotation()?.let { AnnotationValue(it) } is PsiArrayInitializerMemberValue -> ArrayValue(initializers.mapNotNull { it.toValue() }) - is PsiReferenceExpression -> driOfReference()?.let { EnumValue(text ?: "", DRI.from(it)) } + is PsiReferenceExpression -> psiReference?.let { EnumValue(text ?: "", DRI.from(it)) } is PsiClassObjectAccessExpression -> ClassValue( text ?: "", DRI.from(((type as PsiImmediateClassType).parameters.single() as PsiClassReferenceType).resolve()!!) @@ -429,7 +429,7 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { else -> StringValue(text ?: "") } - private fun PsiAnnotation.toAnnotation() = driOfReference()?.let { + private fun PsiAnnotation.toAnnotation() = psiReference?.let { Annotations.Annotation( DRI.from(it), attributes.filter { it !is KtLightAbstractAnnotation }.mapNotNull { it.attributeName to it.toValue() } @@ -440,7 +440,8 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { ) } - private fun PsiElement.driOfReference() = getChildOfType<PsiJavaCodeReferenceElement>()?.resolve() + private val PsiElement.psiReference + get() = getChildOfType<PsiJavaCodeReferenceElement>()?.resolve() } private data class Ancestor(val dri: DRI, val isInterface: Boolean) |