diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Java/JavaDocumentationBuilder.kt | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/Java/JavaDocumentationBuilder.kt b/src/Java/JavaDocumentationBuilder.kt index 0a9632bf..d57ffb0c 100644 --- a/src/Java/JavaDocumentationBuilder.kt +++ b/src/Java/JavaDocumentationBuilder.kt @@ -18,7 +18,7 @@ import com.intellij.psi.PsiTypeParameter import com.intellij.psi.javadoc.PsiDocTag import com.intellij.psi.javadoc.PsiDocTagValue import com.intellij.psi.PsiEllipsisType -import com.intellij.psi.PsiElement +import com.intellij.psi.PsiField public class JavaDocumentationBuilder(private val options: DocumentationOptions) { fun appendFile(file: PsiJavaFile, module: DocumentationModule) { @@ -94,10 +94,21 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions) getImplementsListTypes().forEach { node.appendType(it, Kind.Supertype) } node.appendDetails(getTypeParameters()) { build() } node.appendMembers(getMethods()) { build() } + node.appendMembers(getFields()) { build() } node.appendMembers(getInnerClasses()) { build() } return node } + fun PsiField.build(): DocumentationNode { + val node = DocumentationNode(this, + if (hasModifierProperty(PsiModifier.STATIC)) DocumentationNode.Kind.ClassObjectProperty else DocumentationNode.Kind.Property) + if (!hasModifierProperty(PsiModifier.FINAL)) { + node.append(DocumentationNode("var", Content.Empty, Kind.Modifier), DocumentationReference.Kind.Detail) + } + node.appendType(getType()) + return node + } + fun PsiMethod.build(): DocumentationNode { val node = DocumentationNode(this, if (isConstructor()) Kind.Constructor else Kind.Function, |