aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/transformers/pages/sourcelinks
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-08-21 15:59:58 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-08-24 17:05:30 +0200
commitad1e4c2833abcc78d7a795b4ec4ac50ebf17520b (patch)
tree1c98a650999075a753356ae17402fa6f083b75a3 /plugins/base/src/main/kotlin/transformers/pages/sourcelinks
parent8ba5f2d4c0d8a476e5c4dbf3bcb75116f7e7ba50 (diff)
downloaddokka-ad1e4c2833abcc78d7a795b4ec4ac50ebf17520b.tar.gz
dokka-ad1e4c2833abcc78d7a795b4ec4ac50ebf17520b.tar.bz2
dokka-ad1e4c2833abcc78d7a795b4ec4ac50ebf17520b.zip
SourceLinksTransformer: Use java.io.File to match source files
Diffstat (limited to 'plugins/base/src/main/kotlin/transformers/pages/sourcelinks')
-rw-r--r--plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt
index 8eb7208b..13f70603 100644
--- a/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt
+++ b/plugins/base/src/main/kotlin/transformers/pages/sourcelinks/SourceLinksTransformer.kt
@@ -16,6 +16,7 @@ import org.jetbrains.dokka.transformers.pages.PageTransformer
import org.jetbrains.kotlin.descriptors.DeclarationDescriptorWithSource
import org.jetbrains.kotlin.resolve.source.getPsi
import org.jetbrains.kotlin.utils.addToStdlib.cast
+import java.io.File
class SourceLinksTransformer(val context: DokkaContext, val builder: PageContentBuilder) : PageTransformer {
@@ -35,7 +36,7 @@ class SourceLinksTransformer(val context: DokkaContext, val builder: PageContent
private fun resolveSources(documentable: WithExpectActual) = documentable.sources
.mapNotNull { entry ->
- getSourceLinks().find { entry.value.path.contains(it.path) && it.sourceSetData == entry.key }?.let {
+ getSourceLinks().find { File(entry.value.path).startsWith(it.path) && it.sourceSetData == entry.key }?.let {
Pair(
entry.key,
entry.value.toLink(it)