diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt | 1 | ||||
-rw-r--r-- | core/src/test/kotlin/javadoc/JavadocTest.kt | 11 | ||||
-rw-r--r-- | core/testdata/javadoc/paramlink.kt | 10 |
3 files changed, 22 insertions, 0 deletions
diff --git a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt index 39ad79a6..d2748ee3 100644 --- a/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt +++ b/core/src/main/kotlin/Java/JavaPsiDocumentationBuilder.kt @@ -15,6 +15,7 @@ fun getSignature(element: PsiElement?) = when(element) { private fun PsiType.typeSignature(): String = when(this) { is PsiArrayType -> "Array((${componentType.typeSignature()}))" + is PsiPrimitiveType -> "kotlin." + canonicalText.capitalize() else -> mapTypeName(this) } diff --git a/core/src/test/kotlin/javadoc/JavadocTest.kt b/core/src/test/kotlin/javadoc/JavadocTest.kt index 614a786e..48bc9f6a 100644 --- a/core/src/test/kotlin/javadoc/JavadocTest.kt +++ b/core/src/test/kotlin/javadoc/JavadocTest.kt @@ -76,6 +76,17 @@ class JavadocTest { } } + @Test fun testLinkWithParam() { + verifyJavadoc("testdata/javadoc/paramlink.kt", withKotlinRuntime = true) { doc -> + val classDoc = doc.classNamed("demo.Apple")!! + assertNotNull(classDoc.asClassDoc()) + val tags = classDoc.inlineTags().filterIsInstance<SeeTagAdapter>() + assertEquals(2, tags.size) + val linkTag = tags[1] as SeeMethodTagAdapter + assertEquals("cutIntoPieces", linkTag.method.name()) + } + } + private fun verifyJavadoc(name: String, withJdk: Boolean = false, withKotlinRuntime: Boolean = false, diff --git a/core/testdata/javadoc/paramlink.kt b/core/testdata/javadoc/paramlink.kt new file mode 100644 index 00000000..48972a22 --- /dev/null +++ b/core/testdata/javadoc/paramlink.kt @@ -0,0 +1,10 @@ +package demo + +/** + * You can [eat] it or cut it into slices using [cutIntoPieces] + */ +interface Apple { + fun eat() + + fun cutIntoPieces(pieces: Int) +} |