diff options
| author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-06-25 14:22:28 +0200 |
|---|---|---|
| committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-06-25 14:56:46 +0200 |
| commit | 973d63bc2d4f5ac912e7c78f019c6689b3acbdc3 (patch) | |
| tree | 3be1ac66c5370a3d64c947d6aa9d6c0ae7b1399e /plugins/base/src/main/kotlin/translators/descriptors | |
| parent | 583ece7448baedf17a2db5bad6af42d954c0f607 (diff) | |
| download | dokka-973d63bc2d4f5ac912e7c78f019c6689b3acbdc3.tar.gz dokka-973d63bc2d4f5ac912e7c78f019c6689b3acbdc3.tar.bz2 dokka-973d63bc2d4f5ac912e7c78f019c6689b3acbdc3.zip | |
Fixed requested changes
Diffstat (limited to 'plugins/base/src/main/kotlin/translators/descriptors')
| -rw-r--r-- | plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index ad872e2a..49d8ae0f 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -696,16 +696,15 @@ private class DokkaDescriptorVisitor( else -> StringValue(toString()) } - private fun AnnotationDescriptor.toAnnotation(): Annotations.Annotation? = - DRI.from(annotationClass as DeclarationDescriptor).let { - Annotations.Annotation( - it, - allValueArguments.map { it.key.asString() to it.value.toValue() }.filter { - it.second != null - }.toMap() as Map<String, AnnotationParameterValue>, - annotationClass!!.annotations.hasAnnotation(FqName("kotlin.annotation.MustBeDocumented")) - ) - } + private fun AnnotationDescriptor.toAnnotation(): Annotations.Annotation { + return Annotations.Annotation( + DRI.from(annotationClass as DeclarationDescriptor), + allValueArguments.map { it.key.asString() to it.value.toValue() }.filter { + it.second != null + }.toMap() as Map<String, AnnotationParameterValue>, + annotationClass!!.annotations.hasAnnotation(FqName("kotlin.annotation.MustBeDocumented")) + ) + } private fun PropertyDescriptor.getAnnotationsWithBackingField(): List<Annotations.Annotation> = getAnnotations() + (backingField?.getAnnotations() ?: emptyList()) |
