diff options
Diffstat (limited to 'src/Kotlin/DocumentationBuilder.kt')
-rw-r--r-- | src/Kotlin/DocumentationBuilder.kt | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt index 0b978370..5af4c9f1 100644 --- a/src/Kotlin/DocumentationBuilder.kt +++ b/src/Kotlin/DocumentationBuilder.kt @@ -12,6 +12,8 @@ import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor import org.jetbrains.kotlin.resolve.constants.CompileTimeConstant import com.intellij.openapi.util.text.StringUtil import org.jetbrains.kotlin.descriptors.impl.EnumEntrySyntheticClassDescriptor +import org.jetbrains.kotlin.resolve.source.getPsi +import org.jetbrains.kotlin.psi.JetParameter public data class DocumentationOptions(val includeNonPublic: Boolean = false) @@ -307,6 +309,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 |