aboutsummaryrefslogtreecommitdiff
path: root/plugins/kotlin-as-java/src
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2022-08-18 19:33:53 +0200
committerGitHub <noreply@github.com>2022-08-18 19:33:53 +0200
commit50a3323322265ff3b5dab1d861a25bbb1167812a (patch)
tree0966cfab6d9155724a65439a5c0d1476d66b0a7a /plugins/kotlin-as-java/src
parentdf8d9879b818799c83ff731b3a78e7d2b96fd8e5 (diff)
downloaddokka-50a3323322265ff3b5dab1d861a25bbb1167812a.tar.gz
dokka-50a3323322265ff3b5dab1d861a25bbb1167812a.tar.bz2
dokka-50a3323322265ff3b5dab1d861a25bbb1167812a.zip
Add deprecation details block (#2622)
Diffstat (limited to 'plugins/kotlin-as-java/src')
-rw-r--r--plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt27
1 files changed, 15 insertions, 12 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 b21745a9..05442b54 100644
--- a/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt
+++ b/plugins/kotlin-as-java/src/main/kotlin/signatures/JavaSignatureProvider.kt
@@ -44,10 +44,10 @@ class JavaSignatureProvider internal constructor(ctcc: CommentsToContentConverte
contentBuilder.contentFor(
e,
ContentKind.Symbol,
- setOf(TextStyle.Monospace) + e.stylesIfDeprecated(it),
+ setOf(TextStyle.Monospace),
sourceSets = setOf(it)
) {
- link(e.name, e.dri)
+ link(e.name, e.dri, styles = mainStyles + e.stylesIfDeprecated(it))
}
}
@@ -61,7 +61,7 @@ class JavaSignatureProvider internal constructor(ctcc: CommentsToContentConverte
contentBuilder.contentFor(
c,
ContentKind.Symbol,
- setOf(TextStyle.Monospace) + deprecationStyles,
+ setOf(TextStyle.Monospace),
sourceSets = setOf(sourceSet)
) {
annotationsBlock(c)
@@ -79,7 +79,7 @@ class JavaSignatureProvider internal constructor(ctcc: CommentsToContentConverte
is DObject -> keyword("class ")
is DAnnotation -> keyword("@interface ")
}
- link(c.name!!, c.dri)
+ link(c.name!!, c.dri, styles = mainStyles + deprecationStyles)
if (c is WithGenerics) {
list(c.generics, prefix = "<", suffix = ">",
separatorStyles = mainStyles + TokenStyle.Punctuation,
@@ -110,7 +110,7 @@ class JavaSignatureProvider internal constructor(ctcc: CommentsToContentConverte
contentBuilder.contentFor(
p,
ContentKind.Symbol,
- setOf(TextStyle.Monospace, TextStyle.Block) + p.stylesIfDeprecated(it),
+ setOf(TextStyle.Monospace, TextStyle.Block),
sourceSets = setOf(it)
) {
annotationsBlock(p)
@@ -119,7 +119,7 @@ class JavaSignatureProvider internal constructor(ctcc: CommentsToContentConverte
p.modifiers()[it]?.toSignatureString()?.let { keyword(it) }
signatureForProjection(p.type)
text(nbsp.toString())
- link(p.name, p.dri)
+ link(p.name, p.dri, styles = mainStyles + p.stylesIfDeprecated(it))
}
}
@@ -128,7 +128,7 @@ class JavaSignatureProvider internal constructor(ctcc: CommentsToContentConverte
contentBuilder.contentFor(
f,
ContentKind.Symbol,
- setOf(TextStyle.Monospace, TextStyle.Block) + f.stylesIfDeprecated(sourceSet),
+ setOf(TextStyle.Monospace, TextStyle.Block),
sourceSets = setOf(sourceSet)
) {
annotationsBlock(f)
@@ -138,7 +138,7 @@ class JavaSignatureProvider internal constructor(ctcc: CommentsToContentConverte
val returnType = f.type
signatureForProjection(returnType)
text(nbsp.toString())
- link(f.name, f.dri, styles = mainStyles + TokenStyle.Function)
+ link(f.name, f.dri, styles = mainStyles + TokenStyle.Function + f.stylesIfDeprecated(sourceSet))
val usedGenerics = if (f.isConstructor) f.generics.filter { f uses it } else f.generics
list(usedGenerics, prefix = "<", suffix = ">",
separatorStyles = mainStyles + TokenStyle.Punctuation,
@@ -161,12 +161,15 @@ class JavaSignatureProvider internal constructor(ctcc: CommentsToContentConverte
private fun signature(t: DTypeParameter) =
t.sourceSets.map {
- contentBuilder.contentFor(t, styles = t.stylesIfDeprecated(it), sourceSets = setOf(it)) {
+ contentBuilder.contentFor(t, sourceSets = setOf(it)) {
annotationsInline(t)
- text(t.name.substringAfterLast("."))
- list(t.bounds, prefix = " extends ",
+ text(t.name.substringAfterLast("."), styles = mainStyles + t.stylesIfDeprecated(it))
+ list(
+ elements = t.bounds,
+ prefix = " extends ",
separatorStyles = mainStyles + TokenStyle.Punctuation,
- surroundingCharactersStyle = mainStyles + TokenStyle.Keyword) {
+ surroundingCharactersStyle = mainStyles + TokenStyle.Keyword
+ ) {
signatureForProjection(it)
}
}