diff options
Diffstat (limited to 'src/Java/JavaDocumentationBuilder.kt')
-rw-r--r-- | src/Java/JavaDocumentationBuilder.kt | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Java/JavaDocumentationBuilder.kt b/src/Java/JavaDocumentationBuilder.kt index d57ffb0c..8408d25a 100644 --- a/src/Java/JavaDocumentationBuilder.kt +++ b/src/Java/JavaDocumentationBuilder.kt @@ -110,8 +110,7 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions) } fun PsiMethod.build(): DocumentationNode { - val node = DocumentationNode(this, - if (isConstructor()) Kind.Constructor else Kind.Function, + val node = DocumentationNode(this, nodeKind(), if (isConstructor()) "<init>" else getName()) if (!isConstructor()) { @@ -122,6 +121,12 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions) return node } + private fun PsiMethod.nodeKind(): Kind = when { + isConstructor() -> Kind.Constructor + hasModifierProperty(PsiModifier.STATIC) -> Kind.ClassObjectFunction + else -> Kind.Function + } + fun PsiParameter.build(): DocumentationNode { val node = DocumentationNode(this, Kind.Parameter) node.appendType(getType()) @@ -144,7 +149,7 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions) return } PsiModifier.MODIFIERS.forEach { - if (modifierList.hasExplicitModifier(it)) { + if (it != "static" && modifierList.hasExplicitModifier(it)) { val modifierNode = DocumentationNode(it, Content.Empty, Kind.Modifier) append(modifierNode, DocumentationReference.Kind.Detail) } |