aboutsummaryrefslogtreecommitdiff
path: root/src/Java/JavaDocumentationBuilder.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/JavaDocumentationBuilder.kt')
-rw-r--r--src/Java/JavaDocumentationBuilder.kt13
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,