diff options
author | Vadim Mishenev <vad-mishenev@yandex.ru> | 2023-11-22 17:14:14 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-22 16:14:14 +0200 |
commit | 610b5520b02ce8275462793e176406d1fb37861c (patch) | |
tree | 3bba662233610e6dba02ff3b40d6743ea9af0f70 /dokka-subprojects/plugin-base/src/test | |
parent | 04623bff02cf5486ca054f986b4b05818800f554 (diff) | |
download | dokka-610b5520b02ce8275462793e176406d1fb37861c.tar.gz dokka-610b5520b02ce8275462793e176406d1fb37861c.tar.bz2 dokka-610b5520b02ce8275462793e176406d1fb37861c.zip |
Do not find javadoc for non-JVM source set (#3346)
* Add test
* Do not find javadoc for non-JVM source set
* [K2] Add javadoc parser for external documentable Provider
Diffstat (limited to 'dokka-subprojects/plugin-base/src/test')
-rw-r--r-- | dokka-subprojects/plugin-base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/dokka-subprojects/plugin-base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt b/dokka-subprojects/plugin-base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt index 9b646f24..c8a18788 100644 --- a/dokka-subprojects/plugin-base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt +++ b/dokka-subprojects/plugin-base/src/test/kotlin/model/MultiLanguageInheritanceTest.kt @@ -4,6 +4,7 @@ package model +import org.jetbrains.dokka.Platform import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.PointingToDeclaration @@ -27,6 +28,48 @@ class MultiLanguageInheritanceTest : BaseAbstractTest() { } @Test + fun `should not try to find javadoc for non JVM source set`() { + // Bug #3209 is actual for Dokka K1 + // Technical note: `KtPropertyAccessor`, i.e. `<get-withHintType>`, is not KtCallableDeclaration so `findKDoc` returns null + // Meanwhile, `getJavaDocs()` for KtPropertyAccessor tries to unexpectedly parse the KDoc documentation of property, i.e. `withHintType` + + val nonJvmConfiguration = dokkaConfiguration { + suppressObviousFunctions = false + sourceSets { + sourceSet { + analysisPlatform = Platform.common.key + sourceRoots = listOf("src/main/kotlin") + } + } + } + + testInline( + """ + |/src/main/kotlin/sample/Parent.kt + |package sample + | + |/** + | * Sample description from parent + | */ + |interface Parent { + | /** + | * Sample description from parent + | */ + | val withHintType: String + |} + | + |/src/main/kotlin/sample/Child.kt + |package sample + |public class Child : Parent { + | override val withHintType: String + | get() = "" + |} + """.trimIndent(), + nonJvmConfiguration + ) { } + } + + @Test fun `from java to kotlin`() { testInline( """ |