aboutsummaryrefslogtreecommitdiff
path: root/src/Kotlin/DocumentationBuilder.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/Kotlin/DocumentationBuilder.kt')
-rw-r--r--src/Kotlin/DocumentationBuilder.kt11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt
index 1e09e110..6403f14c 100644
--- a/src/Kotlin/DocumentationBuilder.kt
+++ b/src/Kotlin/DocumentationBuilder.kt
@@ -17,6 +17,8 @@ import java.io.File
import com.intellij.psi.PsiDocumentManager
import com.intellij.psi.PsiNameIdentifierOwner
import com.intellij.psi.PsiElement
+import org.jetbrains.kotlin.resolve.source.getPsi
+import org.jetbrains.kotlin.psi.JetParameter
public data class DocumentationOptions(val includeNonPublic: Boolean = false,
val sourceLinks: List<SourceLinkDefinition>)
@@ -351,6 +353,15 @@ class DocumentationBuilder(val session: ResolveSession, val options: Documentati
} else {
node.appendType(getType())
}
+ if (hasDefaultValue()) {
+ val psi = getSource().getPsi() as? JetParameter
+ if (psi != null) {
+ val defaultValueText = psi.getDefaultValue()?.getText()
+ if (defaultValueText != null) {
+ node.append(DocumentationNode(defaultValueText, Content.Empty, Kind.Value), DocumentationReference.Kind.Detail)
+ }
+ }
+ }
node.appendAnnotations(this)
register(this, node)
return node