diff options
-rw-r--r-- | src/Java/JavaDocumentationBuilder.kt | 2 | ||||
-rw-r--r-- | test/data/java/arrayType.java | 7 | ||||
-rw-r--r-- | test/src/model/JavaTest.kt | 13 |
3 files changed, 22 insertions, 0 deletions
diff --git a/src/Java/JavaDocumentationBuilder.kt b/src/Java/JavaDocumentationBuilder.kt index 1904f621..760a9a3a 100644 --- a/src/Java/JavaDocumentationBuilder.kt +++ b/src/Java/JavaDocumentationBuilder.kt @@ -13,6 +13,7 @@ import com.intellij.psi.PsiClassType import com.intellij.psi.PsiPrimitiveType import com.intellij.psi.PsiModifierListOwner import com.intellij.psi.PsiModifier +import com.intellij.psi.PsiArrayType public class JavaDocumentationBuilder() { fun appendFile(file: PsiJavaFile, module: DocumentationModule) { @@ -100,6 +101,7 @@ public class JavaDocumentationBuilder() { PsiType.VOID -> "Unit" is PsiPrimitiveType -> psiType.getCanonicalText().capitalize() is PsiClassType -> psiType.getClassName() + is PsiArrayType -> "Array<${mapTypeName(psiType.getComponentType())}>" else -> psiType.getCanonicalText() } } diff --git a/test/data/java/arrayType.java b/test/data/java/arrayType.java new file mode 100644 index 00000000..a50e3bf6 --- /dev/null +++ b/test/data/java/arrayType.java @@ -0,0 +1,7 @@ +package test; + +class Test { + public String[] arrayToString(int[] data) { + return null; + } +} diff --git a/test/src/model/JavaTest.kt b/test/src/model/JavaTest.kt index b0e3a133..d40b3ba3 100644 --- a/test/src/model/JavaTest.kt +++ b/test/src/model/JavaTest.kt @@ -54,4 +54,17 @@ public class JavaTest { } } } + + Test fun arrayType() { + verifyModel("test/data/java/arrayType.java") { model -> + val pkg = model.members.single() + with(pkg.members.single().members.single()) { + assertEquals("Array<String>", detail(DocumentationNode.Kind.Type).name) + with(details(DocumentationNode.Kind.Parameter).single()) { + assertEquals("Array<Int>", detail(DocumentationNode.Kind.Type).name) + } + } + } + } + } |