diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-05-04 13:53:10 +0200 |
---|---|---|
committer | Paweł Marks <Kordyjan@users.noreply.github.com> | 2020-05-26 11:32:03 +0200 |
commit | d47d386ad8c0ff4a2c3b9d5b4450a773bdcba2dc (patch) | |
tree | 364724f661349211f053ea80db1a7feb283f48ba /plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt | |
parent | b1e3033fca65ac1e8e312e51d2eed4f278ddb076 (diff) | |
download | dokka-d47d386ad8c0ff4a2c3b9d5b4450a773bdcba2dc.tar.gz dokka-d47d386ad8c0ff4a2c3b9d5b4450a773bdcba2dc.tar.bz2 dokka-d47d386ad8c0ff4a2c3b9d5b4450a773bdcba2dc.zip |
Enhance signature presentation. Support presetnation Java as Kotlin and Kotlin as Java. Refactor annotations creation from PSI/Descriptors. Add proper rendering of annotation signatures in both kotlin syntax and java syntax. Tests for annotations
Diffstat (limited to 'plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt')
-rw-r--r-- | plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt new file mode 100644 index 00000000..3ce4be0a --- /dev/null +++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureUtils.kt @@ -0,0 +1,24 @@ +package org.jetbrains.dokka.base.signatures + +import javaslang.Tuple2 +import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder +import org.jetbrains.dokka.model.Documentable +import org.jetbrains.dokka.model.ExtraModifiers +import org.jetbrains.dokka.model.ExtraModifiers.Companion.kotlinOnlyModifiers +import org.jetbrains.dokka.model.properties.WithExtraProperties + +object KotlinSignatureUtils : JvmSingatureUtils { + + private val strategy = OnlyOnce + private val listBrackets = Tuple2('[', ']') + private val classExtension = "::class" + + override fun PageContentBuilder.DocumentableContentBuilder.annotationsBlock(d: Documentable) = + annotationsBlockWithIgnored(d, emptySet(), strategy, listBrackets, classExtension) + + override fun PageContentBuilder.DocumentableContentBuilder.annotationsInline(d: Documentable) = + annotationsInlineWithIgnored(d, emptySet(), strategy, listBrackets, classExtension) + + override fun <T : Documentable> WithExtraProperties<T>.modifiers() = + modifiersWithFilter(kotlinOnlyModifiers) +}
\ No newline at end of file |