aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/translators/documentables
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2022-08-24 14:18:26 +0200
committerGitHub <noreply@github.com>2022-08-24 14:18:26 +0200
commit97628db0d7622140158ed6679b67b4e2e4355194 (patch)
treec55a94399aaa9004c161b8b7da2c346f9697ad9c /plugins/base/src/main/kotlin/translators/documentables
parentee513880e09c011578d31922119073e3bda18453 (diff)
downloaddokka-97628db0d7622140158ed6679b67b4e2e4355194.tar.gz
dokka-97628db0d7622140158ed6679b67b4e2e4355194.tar.bz2
dokka-97628db0d7622140158ed6679b67b4e2e4355194.zip
Fix incorrect handling of static members used within `@see` tag (#2627)
Diffstat (limited to 'plugins/base/src/main/kotlin/translators/documentables')
-rw-r--r--plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt18
1 files changed, 10 insertions, 8 deletions
diff --git a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
index de31e448..44e2728a 100644
--- a/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
+++ b/plugins/base/src/main/kotlin/translators/documentables/DefaultPageCreator.kt
@@ -11,6 +11,7 @@ import org.jetbrains.dokka.base.transformers.pages.comments.CommentsToContentCon
import org.jetbrains.dokka.base.transformers.pages.tags.CustomTagContentProvider
import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder.DocumentableContentBuilder
import org.jetbrains.dokka.links.DRI
+import org.jetbrains.dokka.links.PointingToDeclaration
import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.model.doc.*
import org.jetbrains.dokka.model.properties.PropertyContainer
@@ -592,26 +593,26 @@ open class DefaultPageCreator(
availablePlatforms.forEach { platform ->
val possibleFallbacks = sourceSets.getPossibleFallbackSourcesets(platform)
seeAlsoTags.forEach { (_, see) ->
- (see[platform] ?: see.fallback(possibleFallbacks))?.let {
+ (see[platform] ?: see.fallback(possibleFallbacks))?.let { seeTag ->
row(
sourceSets = setOf(platform),
kind = ContentKind.Comment,
styles = this@group.mainStyles,
) {
- it.address?.let { dri ->
+ seeTag.address?.let { dri ->
link(
- dri.classNames ?: it.name,
- dri,
+ text = seeTag.name.removePrefix("${dri.packageName}."),
+ address = dri,
kind = ContentKind.Comment,
styles = mainStyles + ContentStyle.RowTitle
)
} ?: text(
- it.name,
+ text = seeTag.name,
kind = ContentKind.Comment,
styles = mainStyles + ContentStyle.RowTitle
)
- if (it.isNotEmpty()) {
- comment(it.root)
+ if (seeTag.isNotEmpty()) {
+ comment(seeTag.root)
}
}
}
@@ -641,7 +642,8 @@ open class DefaultPageCreator(
row(sourceSets = setOf(sourceset)) {
group(styles = mainStyles + ContentStyle.RowTitle) {
throws.exceptionAddress?.let {
- link(text = it.classNames ?: entry.key, address = it)
+ val className = it.takeIf { it.target is PointingToDeclaration }?.classNames
+ link(text = className ?: entry.key, address = it)
} ?: text(entry.key)
}
if (throws.isNotEmpty()) {