From 1f592a7ec2786e0a0b77d224d1414ef3042caae4 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Wed, 20 Jan 2021 10:41:48 +0100 Subject: Annotations for parameters (#1704) --- .../descriptors/DefaultDescriptorToDocumentableTranslator.kt | 5 ++++- .../translators/psi/DefaultPsiToDocumentableTranslator.kt | 12 ++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) (limited to 'plugins/base/src/main/kotlin') diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index 1ac519a0..18231601 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -777,7 +777,10 @@ private class DokkaDescriptorVisitor( null, upperBounds.map { it.toBound() }, setOf(sourceSet), - extra = PropertyContainer.withAll(additionalExtras().toSourceSetDependent().toAdditionalModifiers()) + extra = PropertyContainer.withAll( + additionalExtras().toSourceSetDependent().toAdditionalModifiers(), + getAnnotations().toSourceSetDependent().toAnnotations() + ) ) private suspend fun org.jetbrains.kotlin.descriptors.annotations.Annotations.getPresentableName(): String? = diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index cd51e9dd..5b913dcb 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -360,7 +360,11 @@ class DefaultPsiToDocumentableTranslator( ).toSourceSetDependent(), null, getBound(psiParameter.type), - setOf(sourceSetData) + setOf(sourceSetData), + PropertyContainer.withAll( + psiParameter.annotations.toList().toListOfAnnotations().toSourceSetDependent() + .toAnnotations() + ) ) }, docs.toSourceSetDependent(), @@ -468,7 +472,11 @@ class DefaultPsiToDocumentableTranslator( javadocParser.parseDocumentation(type).toSourceSetDependent(), null, mapBounds(type.bounds), - setOf(sourceSetData) + setOf(sourceSetData), + PropertyContainer.withAll( + type.annotations.toList().toListOfAnnotations().toSourceSetDependent() + .toAnnotations() + ) ) } } -- cgit