diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-06-09 09:50:20 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-06-25 14:56:46 +0200 |
commit | 1183e09a7123c8f9665248235c5e33ba28e92780 (patch) | |
tree | bd40553578862689ea38ef739c16b5d2ab92cc64 /plugins/base/src/main/kotlin/translators/psi | |
parent | 95f0b2abff0b4fac110da4129dcc8a8ae51e0d32 (diff) | |
download | dokka-1183e09a7123c8f9665248235c5e33ba28e92780.tar.gz dokka-1183e09a7123c8f9665248235c5e33ba28e92780.tar.bz2 dokka-1183e09a7123c8f9665248235c5e33ba28e92780.zip |
Hides internal annotations from rendering #947
Diffstat (limited to 'plugins/base/src/main/kotlin/translators/psi')
-rw-r--r-- | plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index 30204d01..18a1dc3c 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 ?: "", it) } + is PsiReferenceExpression -> driOfReference()?.let { EnumValue(text ?: "", DRI.from(it)) } is PsiClassObjectAccessExpression -> ClassValue( text ?: "", DRI.from(((type as PsiImmediateClassType).parameters.single() as PsiClassReferenceType).resolve()!!) @@ -431,15 +431,16 @@ object DefaultPsiToDocumentableTranslator : SourceToDocumentableTranslator { private fun PsiAnnotation.toAnnotation() = driOfReference()?.let { Annotations.Annotation( - it, + DRI.from(it), attributes.filter { it !is KtLightAbstractAnnotation }.mapNotNull { it.attributeName to it.toValue() } - .toMap() + .toMap(), + (it as PsiClass).annotations.any { + hasQualifiedName("java.lang.annotation.Documented") + } ) } - private fun PsiElement.driOfReference() = getChildOfType<PsiJavaCodeReferenceElement>()?.resolve()?.let { - DRI.from(it) - } + private fun PsiElement.driOfReference() = getChildOfType<PsiJavaCodeReferenceElement>()?.resolve() } private data class Ancestor(val dri: DRI, val isInterface: Boolean) |