diff options
author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-06-15 14:37:39 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-06-25 14:56:46 +0200 |
commit | d96d46f76ed800de45cade90dedc11ec72a37341 (patch) | |
tree | 4346771519250e957a0c344ecf32482170334cee /plugins/base/src | |
parent | fa8b850977788339d1ce62cd0e3e87e681071584 (diff) | |
download | dokka-d96d46f76ed800de45cade90dedc11ec72a37341.tar.gz dokka-d96d46f76ed800de45cade90dedc11ec72a37341.tar.bz2 dokka-d96d46f76ed800de45cade90dedc11ec72a37341.zip |
Remove platoformText function
Diffstat (limited to 'plugins/base/src')
-rw-r--r-- | plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt index 66596e2d..653bab01 100644 --- a/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt +++ b/plugins/base/src/main/kotlin/signatures/KotlinSignatureProvider.kt @@ -60,16 +60,15 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog contentBuilder.contentFor( e, ContentKind.Symbol, - setOf(TextStyle.Monospace) + e.stylesForDeprecated(it), + setOf(TextStyle.Monospace, TextStyle.Block) + e.stylesForDeprecated(it), sourceSets = setOf(it) ) { group(styles = setOf(TextStyle.Block)) { annotationsBlock(e) link(e.name, e.dri, styles = emptySet()) e.extra[ConstructorValues]?.let { constructorValues -> - sourceSetDependentText(constructorValues.values, constructorValues.values.keys) { - it.joinToString(prefix = "(", postfix = ")") - } + constructorValues.values[it] + text(constructorValues.values[it]?.joinToString(prefix = "(", postfix = ")") ?: "") } } } @@ -108,18 +107,15 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog sourceSets = setOf(sourceSet) ) { annotationsBlock(c) - sourceSetDependentText( - c.visibility, - setOf(sourceSet) - ) { it.takeIf { it !in ignoredVisibilities }?.name?.let { "$it " } ?: "" } + text(c.visibility[sourceSet]?.takeIf { it !in ignoredVisibilities }?.name?.let { "$it " } ?: "") if (c is DClass) { - sourceSetDependentText(c.modifier, setOf(sourceSet)) { - if (it !in ignoredModifiers) + text( + if (c.modifier[sourceSet] !in ignoredModifiers) if (c.extra[AdditionalModifiers]?.content?.contains(ExtraModifiers.KotlinOnlyModifiers.Data) == true) "" - else (if (it is JavaModifier.Empty) KotlinModifier.Open else it).let { it.name + " " } + else (if (c.modifier[sourceSet] is JavaModifier.Empty) KotlinModifier.Open.name else c.name).let { "$it " } else "" - } + ) } if (c is DInterface) { c.extra[AdditionalModifiers]?.content?.let { additionalModifiers -> @@ -190,13 +186,13 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog p.sourceSets.map { contentBuilder.contentFor(p, ContentKind.Symbol, setOf(TextStyle.Monospace) + p.stylesForDeprecated(it), sourceSets = setOf(it)) { annotationsBlock(p) - sourceSetDependentText(p.visibility) { it.takeIf { it !in ignoredVisibilities }?.name?.let { "$it " } ?: "" } - sourceSetDependentText(p.modifier) { - it.takeIf { it !in ignoredModifiers }?.let { + text(p.visibility[it].takeIf { it !in ignoredVisibilities }?.name?.let { "$it " } ?: "") + text( + p.modifier[it].takeIf { it !in ignoredModifiers }?.let { if (it is JavaModifier.Empty) KotlinModifier.Open else it }?.name?.let { "$it " } ?: "" - } - processExtraModifiers(p) + ) + text(p.modifiers()[it]?.toSignatureString() ?: "") p.setter?.let { text("var ") } ?: text("val ") list(p.generics, prefix = "<", suffix = "> ") { +buildSignature(it) @@ -215,13 +211,12 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog f.sourceSets.map { contentBuilder.contentFor(f, ContentKind.Symbol, setOf(TextStyle.Monospace) + f.stylesForDeprecated(it), sourceSets = setOf(it)) { annotationsBlock(f) - sourceSetDependentText(f.visibility) { it.takeIf { it !in ignoredVisibilities }?.name?.let { "$it " } ?: "" } - sourceSetDependentText(f.modifier) { - it.takeIf { it !in ignoredModifiers }?.let { + text(f.visibility[it]?.takeIf { it !in ignoredVisibilities }?.name?.let { "$it " } ?: "") + text(f.modifier[it]?.takeIf { it !in ignoredModifiers }?.let { if (it is JavaModifier.Empty) KotlinModifier.Open else it }?.name?.let { "$it " } ?: "" - } - processExtraModifiers(f) + ) + text(f.modifiers()[it]?.toSignatureString() ?: "") text("fun ") list(f.generics, prefix = "<", suffix = "> ") { +buildSignature(it) @@ -264,7 +259,7 @@ class KotlinSignatureProvider(ctcc: CommentsToContentConverter, logger: DokkaLog setOf(TextStyle.Monospace), sourceSets = platforms.toSet() ) { - sourceSetDependentText(t.visibility) { it.takeIf { it !in ignoredVisibilities }?.name?.let { "$it " } ?: "" } + text(t.visibility[it]?.takeIf { it !in ignoredVisibilities }?.name?.let { "$it " } ?: "") processExtraModifiers(t) text("typealias ") signatureForProjection(t.type) |