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/base/src/test/kotlin/utils | |
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/base/src/test/kotlin/utils')
-rw-r--r-- | plugins/base/src/test/kotlin/utils/contentUtils.kt | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/plugins/base/src/test/kotlin/utils/contentUtils.kt b/plugins/base/src/test/kotlin/utils/contentUtils.kt index be796c89..66e5ef53 100644 --- a/plugins/base/src/test/kotlin/utils/contentUtils.kt +++ b/plugins/base/src/test/kotlin/utils/contentUtils.kt @@ -38,19 +38,24 @@ fun ContentMatcherBuilder<*>.bareSignature( +("${keywords.joinToString("") { "$it " }}fun ") link { +name } +"(" - params.forEachIndexed { id, (n, t) -> + if (params.isNotEmpty()) { + group { + params.forEachIndexed { id, (n, t) -> + group { + t.annotations.forEach { + unwrapAnnotation(it) + } + t.keywords.forEach { + +it + } - t.annotations.forEach { - unwrapAnnotation(it) - } - t.keywords.forEach { - +it + +"$n: " + group { link { +(t.type) } } + if (id != params.lastIndex) + +", " + } + } } - - +"$n: " - group { link { +(t.type) } } - if (id != params.lastIndex) - +", " } +")" if (returnType != null) { @@ -101,19 +106,24 @@ fun ContentMatcherBuilder<*>.bareSignatureWithReceiver( +"." link { +name } +"(" - params.forEachIndexed { id, (n, t) -> + if (params.isNotEmpty()) { + group { + params.forEachIndexed { id, (n, t) -> + group { + t.annotations.forEach { + unwrapAnnotation(it) + } + t.keywords.forEach { + +it + } - t.annotations.forEach { - unwrapAnnotation(it) - } - t.keywords.forEach { - +it + +"$n: " + group { link { +(t.type) } } + if (id != params.lastIndex) + +", " + } + } } - - +"$n: " - group { link { +(t.type) } } - if (id != params.lastIndex) - +", " } +")" if (returnType != null) { |