aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorKamil Doległo <9080183+kamildoleglo@users.noreply.github.com>2021-02-05 15:52:49 +0100
committerGitHub <noreply@github.com>2021-02-05 15:52:49 +0100
commitcb010f5988667ec1114c11a09815538361f10d48 (patch)
treeaa42d8b0d7229560add204207e1e8504069e24b7 /plugins
parenta78e47a8d3d0dae7b68b0e414967e20ffb6e9a18 (diff)
downloaddokka-cb010f5988667ec1114c11a09815538361f10d48.tar.gz
dokka-cb010f5988667ec1114c11a09815538361f10d48.tar.bz2
dokka-cb010f5988667ec1114c11a09815538361f10d48.zip
Fix links to method parameters from documentation (#1713)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/base/src/test/kotlin/markdown/LinkTest.kt33
1 files changed, 33 insertions, 0 deletions
diff --git a/plugins/base/src/test/kotlin/markdown/LinkTest.kt b/plugins/base/src/test/kotlin/markdown/LinkTest.kt
index 6e0f47ed..2bcc0bf0 100644
--- a/plugins/base/src/test/kotlin/markdown/LinkTest.kt
+++ b/plugins/base/src/test/kotlin/markdown/LinkTest.kt
@@ -6,6 +6,7 @@ import org.jetbrains.dokka.pages.ClasslikePageNode
import org.jetbrains.dokka.pages.ContentDRILink
import org.jetbrains.dokka.pages.MemberPageNode
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
+import org.jetbrains.dokka.model.doc.DocumentationLink
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Assertions.assertNotNull
import org.junit.jupiter.api.Test
@@ -78,4 +79,36 @@ class LinkTest : BaseAbstractTest() {
}
}
}
+
+ @Test
+ fun `link to parameter #238`() {
+ val configuration = dokkaConfiguration {
+ sourceSets {
+ sourceSet {
+ sourceRoots = listOf("src/")
+ }
+ }
+ }
+
+ testInline(
+ """
+ |/src/main/kotlin/Test.kt
+ |package example
+ |
+ |/**
+ |* Link to [waitAMinute]
+ |*/
+ |fun stop(hammerTime: String, waitAMinute: String) {}
+ |
+ """.trimMargin(),
+ configuration
+ ) {
+ documentablesMergingStage = { module ->
+ val parameter = module.dfs { it.name == "waitAMinute" }
+ val link = module.dfs { it.name == "stop" }!!.documentation.values.single().dfs { it is DocumentationLink } as DocumentationLink
+
+ assertEquals(parameter!!.dri, link.dri)
+ }
+ }
+ }
}