aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-01-20 16:44:35 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-07-13 18:30:57 +0300
commit2f1512f5ec7f23181cf5fcad96d9ee66507de472 (patch)
tree8f01017080020a26ebc8f36729f419c27f98d013 /core
parent1391dcca35a871881420c53755fed08bf47e4087 (diff)
downloaddokka-2f1512f5ec7f23181cf5fcad96d9ee66507de472.tar.gz
dokka-2f1512f5ec7f23181cf5fcad96d9ee66507de472.tar.bz2
dokka-2f1512f5ec7f23181cf5fcad96d9ee66507de472.zip
[backport] Add value for constants from Kotlin
Original: fab0890
Diffstat (limited to 'core')
-rw-r--r--core/src/main/kotlin/Kotlin/DocumentationBuilder.kt6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
index 125f9fd4..39202173 100644
--- a/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
+++ b/core/src/main/kotlin/Kotlin/DocumentationBuilder.kt
@@ -23,6 +23,7 @@ import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.KtModifierListOwner
import org.jetbrains.kotlin.psi.KtParameter
+import org.jetbrains.kotlin.psi.KtVariableDeclaration
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.constants.ConstantValue
import org.jetbrains.kotlin.resolve.descriptorUtil.*
@@ -781,6 +782,11 @@ class DocumentationBuilder
if (isVar) {
node.appendTextNode("var", NodeKind.Modifier)
}
+ if (isConst) {
+ val psi = sourcePsi() as? KtVariableDeclaration
+ val text = psi?.initializer?.text
+ text?.let { node.appendTextNode(it, NodeKind.Value) }
+ }
getter?.let {
if (!it.isDefault) {