diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2023-08-31 20:16:01 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-31 20:16:01 +0200 |
commit | 02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33 (patch) | |
tree | 66f6d6f089a93b863bf1144666491eca6729ad05 /plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt | |
parent | 6a181a7a2b03ec263788d137610e86937a57d434 (diff) | |
download | dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.gz dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.tar.bz2 dokka-02f30b142aa467d3a24cc52a1fe3f2fed7ea1e33.zip |
Enable explicit API mode (#3139)
Diffstat (limited to 'plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt')
-rw-r--r-- | plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt index 7999c22e..f16fbeb0 100644 --- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt +++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt @@ -4,6 +4,7 @@ package org.jetbrains.dokka.base.signatures +import org.jetbrains.dokka.DokkaConfiguration import org.jetbrains.dokka.base.transformers.pages.annotations.SinceKotlinTransformer import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder import org.jetbrains.dokka.links.DRI @@ -14,7 +15,7 @@ import org.jetbrains.dokka.model.AnnotationTarget import org.jetbrains.dokka.model.properties.WithExtraProperties import org.jetbrains.dokka.pages.ContentKind -object KotlinSignatureUtils : JvmSignatureUtils { +public object KotlinSignatureUtils : JvmSignatureUtils { private const val classExtension = "::class" private val strategy = OnlyOnce @@ -34,21 +35,24 @@ object KotlinSignatureUtils : JvmSignatureUtils { ) - override fun PageContentBuilder.DocumentableContentBuilder.annotationsBlock(d: AnnotationTarget) = + override fun PageContentBuilder.DocumentableContentBuilder.annotationsBlock(d: AnnotationTarget) { annotationsBlockWithIgnored(d, ignoredAnnotations, strategy, listBrackets, classExtension) + } - override fun PageContentBuilder.DocumentableContentBuilder.annotationsInline(d: AnnotationTarget) = + override fun PageContentBuilder.DocumentableContentBuilder.annotationsInline(d: AnnotationTarget) { annotationsInlineWithIgnored(d, ignoredAnnotations, strategy, listBrackets, classExtension) + } - override fun <T : Documentable> WithExtraProperties<T>.modifiers() = - extra[AdditionalModifiers]?.content?.entries?.associate { + override fun <T : Documentable> WithExtraProperties<T>.modifiers(): SourceSetDependent<Set<ExtraModifiers>> { + return extra[AdditionalModifiers]?.content?.entries?.associate { it.key to it.value.filterIsInstance<ExtraModifiers.KotlinOnlyModifiers>().toSet() } ?: emptyMap() + } - val PrimitiveJavaType.dri: DRI get() = DRI("kotlin", name.capitalize()) + public val PrimitiveJavaType.dri: DRI get() = DRI("kotlin", name.capitalize()) - val Bound.driOrNull: DRI? + public val Bound.driOrNull: DRI? get() { return when (this) { is TypeParameter -> dri @@ -64,7 +68,7 @@ object KotlinSignatureUtils : JvmSignatureUtils { } } - val Projection.drisOfAllNestedBounds: List<DRI> get() = when (this) { + public val Projection.drisOfAllNestedBounds: List<DRI> get() = when (this) { is TypeParameter -> listOf(dri) is TypeConstructor -> listOf(dri) + projections.flatMap { it.drisOfAllNestedBounds } is Nullable -> inner.drisOfAllNestedBounds |