From 4a458963ff15d113d7833cebba55065a910b135c Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 16 Feb 2015 12:32:41 +0100 Subject: handle vararg types --- src/Java/JavaDocumentationBuilder.kt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/Java/JavaDocumentationBuilder.kt b/src/Java/JavaDocumentationBuilder.kt index c76c4c33..9d8c85a9 100644 --- a/src/Java/JavaDocumentationBuilder.kt +++ b/src/Java/JavaDocumentationBuilder.kt @@ -17,6 +17,7 @@ import com.intellij.psi.PsiArrayType import com.intellij.psi.PsiTypeParameter import com.intellij.psi.javadoc.PsiDocTag import com.intellij.psi.javadoc.PsiDocTagValue +import com.intellij.psi.PsiEllipsisType public class JavaDocumentationBuilder() { fun appendFile(file: PsiJavaFile, module: DocumentationModule) { @@ -107,6 +108,9 @@ public class JavaDocumentationBuilder() { fun PsiParameter.build(): DocumentationNode { val node = DocumentationNode(this, Kind.Parameter) node.appendType(getType()) + if (getType() is PsiEllipsisType) { + node.append(DocumentationNode("vararg", Content.Empty, Kind.Annotation), DocumentationReference.Kind.Annotation) + } return node } @@ -150,6 +154,7 @@ public class JavaDocumentationBuilder() { PsiType.VOID -> "Unit" is PsiPrimitiveType -> psiType.getCanonicalText().capitalize() is PsiClassType -> psiType.getClassName() + is PsiEllipsisType -> mapTypeName(psiType.getComponentType()) is PsiArrayType -> "Array<${mapTypeName(psiType.getComponentType())}>" else -> psiType.getCanonicalText() } -- cgit