aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/resolvers/external/Dokka010ExternalLocationProvider.kt
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/main/kotlin/resolvers/external/Dokka010ExternalLocationProvider.kt')
-rw-r--r--plugins/base/src/main/kotlin/resolvers/external/Dokka010ExternalLocationProvider.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/base/src/main/kotlin/resolvers/external/Dokka010ExternalLocationProvider.kt b/plugins/base/src/main/kotlin/resolvers/external/Dokka010ExternalLocationProvider.kt
index 33bc96d8..c645157a 100644
--- a/plugins/base/src/main/kotlin/resolvers/external/Dokka010ExternalLocationProvider.kt
+++ b/plugins/base/src/main/kotlin/resolvers/external/Dokka010ExternalLocationProvider.kt
@@ -14,8 +14,10 @@ open class Dokka010ExternalLocationProvider(
override fun resolve(dri: DRI): String? {
val docURL = externalDocumentation.documentationURL.toString().removeSuffix("/") + "/"
+ val fqName = listOfNotNull(dri.packageName.takeIf { it?.isNotBlank() == true },
+ dri.classNames.takeIf { it?.isNotBlank() == true }).joinToString(".")
val relocationId =
- "${dri.packageName}.${dri.classNames}".let { if (dri.callable != null) it + "$" + dri.callable!!.toOldString() else it }
+ fqName.let { if (dri.callable != null) it + "$" + dri.callable!!.toOldString() else it }
externalDocumentation.packageList.locations[relocationId]?.let { path -> return "$docURL$path" }
val classNamesChecked = dri.classNames ?: return "$docURL${dri.packageName ?: ""}/index$extension"
@@ -26,5 +28,5 @@ open class Dokka010ExternalLocationProvider(
return "$docURL$classLink/" + identifierToFilename(callableChecked.name) + extension
}
- private fun Callable.toOldString() = name + params.joinToString(", ", "(", ")") + receiver?.let { "#$it" }
+ private fun Callable.toOldString() = name + params.joinToString(", ", "(", ")") + (receiver?.let { "#$it" } ?: "")
}