aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt')
-rw-r--r--plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt25
1 files changed, 13 insertions, 12 deletions
diff --git a/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt b/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt
index d17fa276..94af96e2 100644
--- a/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt
+++ b/plugins/base/src/main/kotlin/signatures/JvmSignatureUtils.kt
@@ -8,7 +8,6 @@ import org.jetbrains.dokka.pages.*
import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
import org.jetbrains.dokka.base.signatures.KotlinSignatureUtils.drisOfAllNestedBounds
import org.jetbrains.dokka.model.AnnotationTarget
-import org.jetbrains.dokka.model.doc.DocumentationNode
interface JvmSignatureUtils {
@@ -80,21 +79,22 @@ interface JvmSignatureUtils {
when (renderAtStrategy) {
is All, is OnlyOnce -> {
- text("@")
when(a.scope) {
- Annotations.AnnotationScope.GETTER -> text("get:")
- Annotations.AnnotationScope.SETTER -> text("set:")
+ Annotations.AnnotationScope.GETTER -> text("@get:", styles = mainStyles + TokenStyle.Annotation)
+ Annotations.AnnotationScope.SETTER -> text("@set:", styles = mainStyles + TokenStyle.Annotation)
+ else -> text("@", styles = mainStyles + TokenStyle.Annotation)
}
+ link(a.dri.classNames!!, a.dri, styles = mainStyles + TokenStyle.Annotation)
}
- is Never -> Unit
+ is Never -> link(a.dri.classNames!!, a.dri)
}
- link(a.dri.classNames!!, a.dri)
val isNoWrappedBrackets = a.params.entries.isEmpty() && renderAtStrategy is OnlyOnce
listParams(
a.params.entries,
if (isNoWrappedBrackets) null else Pair('(', ')')
) {
- text(it.key + " = ")
+ text(it.key)
+ text(" = ", styles = mainStyles + TokenStyle.Operator)
when (renderAtStrategy) {
is All -> All
is Never, is OnlyOnce -> Never
@@ -116,8 +116,9 @@ interface JvmSignatureUtils {
}
is EnumValue -> link(a.enumName, a.enumDri)
is ClassValue -> link(a.className + classExtension, a.classDRI)
- is StringValue -> group(styles = setOf(TextStyle.Breakable)) { text( "\"${a.text()}\"") }
- is LiteralValue -> group(styles = setOf(TextStyle.Breakable)) { text(a.text()) }
+ is StringValue -> group(styles = setOf(TextStyle.Breakable)) { stringLiteral( "\"${a.text()}\"") }
+ is BooleanValue -> group(styles = setOf(TextStyle.Breakable)) { booleanLiteral(a.value) }
+ is LiteralValue -> group(styles = setOf(TextStyle.Breakable)) { constant(a.text()) }
}
private fun<T> PageContentBuilder.DocumentableContentBuilder.listParams(
@@ -125,14 +126,14 @@ interface JvmSignatureUtils {
listBrackets: Pair<Char, Char>?,
outFn: PageContentBuilder.DocumentableContentBuilder.(T) -> Unit
) {
- listBrackets?.let{ text(it.first.toString()) }
+ listBrackets?.let{ punctuation(it.first.toString()) }
params.forEachIndexed { i, it ->
group(styles = setOf(TextStyle.BreakableAfter)) {
this.outFn(it)
- if (i != params.size - 1) text(", ")
+ if (i != params.size - 1) punctuation(", ")
}
}
- listBrackets?.let{ text(it.second.toString()) }
+ listBrackets?.let{ punctuation(it.second.toString()) }
}
fun PageContentBuilder.DocumentableContentBuilder.annotationsBlockWithIgnored(