diff options
author | Ignat Beresnev <ignat@beresnev.me> | 2022-01-27 12:56:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-27 12:56:27 +0300 |
commit | e0a10c24ea7e623137f2ab21522ed0f84bf59814 (patch) | |
tree | c863973a41efccb4ad34858c88b885e5370b2dbd /plugins/kotlin-as-java/src/main/kotlin | |
parent | 7c44db1ef0075e2b80a4723e0747bbf57c32e775 (diff) | |
download | dokka-e0a10c24ea7e623137f2ab21522ed0f84bf59814.tar.gz dokka-e0a10c24ea7e623137f2ab21522ed0f84bf59814.tar.bz2 dokka-e0a10c24ea7e623137f2ab21522ed0f84bf59814.zip |
KT-50292 - Implement vertical alignment of parameters (#2309)
* Implement vertical alignment (wrapping) of parameters for kt
* Add tests for params wrapping and extend matchers to check for classes
* Add distinguishable parameters block to kotlinAsJava, extract common logic
* Create a separate Kind for symbol function parameters
Diffstat (limited to 'plugins/kotlin-as-java/src/main/kotlin')
-rw-r--r-- | plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt b/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt index 65b34017..fa1f668f 100644 --- a/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt +++ b/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt @@ -8,10 +8,7 @@ import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.model.* import org.jetbrains.dokka.model.properties.WithExtraProperties -import org.jetbrains.dokka.pages.ContentKind -import org.jetbrains.dokka.pages.ContentNode -import org.jetbrains.dokka.pages.TextStyle -import org.jetbrains.dokka.pages.TokenStyle +import org.jetbrains.dokka.pages.* import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.plugability.plugin import org.jetbrains.dokka.plugability.querySingle @@ -143,12 +140,14 @@ class JavaSignatureProvider internal constructor(ctcc: CommentsToContentConverte +buildSignature(it) } punctuation("(") - list(f.parameters, separatorStyles = mainStyles + TokenStyle.Punctuation) { - annotationsInline(it) - text(it.modifiers()[sourceSet]?.toSignatureString() ?: "", styles = mainStyles + TokenStyle.Keyword) - signatureForProjection(it.type) - text(nbsp.toString()) - text(it.name!!) + if (f.parameters.isNotEmpty()) { + parametersBlock(f) { + annotationsInline(it) + text(it.modifiers()[sourceSet]?.toSignatureString() ?: "", styles = mainStyles + TokenStyle.Keyword) + signatureForProjection(it.type) + text(nbsp.toString()) + text(it.name!!) + } } punctuation(")") } |