aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/translators/descriptors
diff options
context:
space:
mode:
authorPaweł Marks <pmarks@virtuslab.com>2020-03-18 18:38:38 +0100
committerPaweł Marks <pmarks@virtuslab.com>2020-03-18 18:38:38 +0100
commit4e7af2084c98f905b4fcd7fbe231c19bf186205d (patch)
tree0c06ae26c8426d71c205246d39bbbd8271228d49 /plugins/base/src/main/kotlin/translators/descriptors
parentc92427162c3232cb54c73f63867258a31be526e9 (diff)
downloaddokka-4e7af2084c98f905b4fcd7fbe231c19bf186205d.tar.gz
dokka-4e7af2084c98f905b4fcd7fbe231c19bf186205d.tar.bz2
dokka-4e7af2084c98f905b4fcd7fbe231c19bf186205d.zip
Make DefaultValue extra property actualy do something
Diffstat (limited to 'plugins/base/src/main/kotlin/translators/descriptors')
-rw-r--r--plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
index 6d834f9c..ae623ff2 100644
--- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
+++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
@@ -19,7 +19,8 @@ import org.jetbrains.kotlin.descriptors.ClassKind
import org.jetbrains.kotlin.descriptors.Visibility
import org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorVisitorEmptyBodies
import org.jetbrains.kotlin.idea.kdoc.findKDoc
-import org.jetbrains.kotlin.psi.KtConstantExpression
+import org.jetbrains.kotlin.psi.KtExpression
+import org.jetbrains.kotlin.psi.psiUtil.findDescendantOfType
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.resolve.calls.components.isVararg
import org.jetbrains.kotlin.resolve.calls.tasks.isDynamic
@@ -531,9 +532,8 @@ private class DokkaDescriptorVisitor( // TODO: close this class and make it priv
)
}.let(::Annotations)
- fun ValueParameterDescriptor.getDefaultValue(): String? = (source as? KotlinSourceElement)?.let {
- it.psi.children.find { it is KtConstantExpression }?.text
- }
+ fun ValueParameterDescriptor.getDefaultValue(): String? =
+ (source as? KotlinSourceElement)?.psi?.children?.find { it is KtExpression }?.text
data class ClassInfo(val supertypes: List<DRI>, val docs: PlatformDependent<DocumentationNode>)