aboutsummaryrefslogtreecommitdiff
path: root/dokka-subprojects/plugin-base/src/main
diff options
context:
space:
mode:
authorAndrey Tyrin <andrei.tyrin@jetbrains.com>2023-11-14 16:35:45 +0100
committerGitHub <noreply@github.com>2023-11-14 16:35:45 +0100
commit94a4edd5ccf43fbdb6ed833761afe659b82d4bf9 (patch)
tree80d7844068ccdcd427d82886260f20f17ea846aa /dokka-subprojects/plugin-base/src/main
parent1fb8d316f519faa2694447fd11a92a8b2c78dd61 (diff)
downloaddokka-94a4edd5ccf43fbdb6ed833761afe659b82d4bf9.tar.gz
dokka-94a4edd5ccf43fbdb6ed833761afe659b82d4bf9.tar.bz2
dokka-94a4edd5ccf43fbdb6ed833761afe659b82d4bf9.zip
Remove empty spans rendering for missed modifiers (#3343)
* Remove property modifiers if there are none * Remove variance modifier rendering if it is absent
Diffstat (limited to 'dokka-subprojects/plugin-base/src/main')
-rw-r--r--dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/signatures/KotlinSignatureProvider.kt6
1 files changed, 3 insertions, 3 deletions
diff --git a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/signatures/KotlinSignatureProvider.kt b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/signatures/KotlinSignatureProvider.kt
index 2180e776..0fc7ca72 100644
--- a/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/signatures/KotlinSignatureProvider.kt
+++ b/dokka-subprojects/plugin-base/src/main/kotlin/org/jetbrains/dokka/base/signatures/KotlinSignatureProvider.kt
@@ -248,7 +248,7 @@ public class KotlinSignatureProvider(
p.modifier[sourceSet].takeIf { it !in ignoredModifiers }?.let {
if (it is JavaModifier.Empty) KotlinModifier.Open else it
}?.name?.let { keyword("$it ") }
- p.modifiers()[sourceSet]?.toSignatureString()?.let { keyword(it) }
+ p.modifiers()[sourceSet]?.toSignatureString()?.takeIf { it.isNotEmpty() }?.let { keyword(it) }
if (p.isMutable()) keyword("var ") else keyword("val ")
list(p.generics, prefix = "<", suffix = "> ",
separatorStyles = mainStyles + TokenStyle.Punctuation,
@@ -303,7 +303,7 @@ public class KotlinSignatureProvider(
f.modifier[sourceSet]?.takeIf { it !in ignoredModifiers }?.let {
if (it is JavaModifier.Empty) KotlinModifier.Open else it
}?.name?.let { keyword("$it ") }
- f.modifiers()[sourceSet]?.toSignatureString()?.let { keyword(it) }
+ f.modifiers()[sourceSet]?.toSignatureString()?.takeIf { it.isNotEmpty() }?.let { keyword(it) }
keyword("fun ")
list(
f.generics, prefix = "<", suffix = "> ",
@@ -434,7 +434,7 @@ public class KotlinSignatureProvider(
}
is Variance<*> -> group(styles = emptySet()) {
- keyword("$p ".takeIf { it.isNotBlank() } ?: "")
+ p.takeIf { it.toString().isNotEmpty() }?.let { keyword("$it ") }
signatureForProjection(p.inner, showFullyQualifiedName)
}