From 460cdf8bc9c54efd736b10ca58a865f034bf2e84 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Fri, 24 Jul 2020 12:51:06 +0200 Subject: Update callable name to include classname not --- .../src/main/kotlin/org/jetbrains/dokka/analysis/CallableFactory.kt | 4 ++-- .../descriptors/DefaultDescriptorToDocumentableTranslator.kt | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CallableFactory.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CallableFactory.kt index ebfe20a5..de48cfae 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CallableFactory.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/CallableFactory.kt @@ -7,9 +7,9 @@ import org.jetbrains.dokka.links.JavaClassReference import org.jetbrains.dokka.links.TypeReference import org.jetbrains.kotlin.descriptors.CallableDescriptor -fun Callable.Companion.from(descriptor: CallableDescriptor) = with(descriptor) { +fun Callable.Companion.from(descriptor: CallableDescriptor, name: String? = null) = with(descriptor) { Callable( - name.asString(), + name ?: descriptor.name.asString(), extensionReceiverParameter?.let { TypeReference.from(it) }, valueParameters.mapNotNull { TypeReference.from(it) } ) diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index 526db8e7..84cd3793 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -369,13 +369,14 @@ private class DokkaDescriptorVisitor( } override fun visitConstructorDescriptor(descriptor: ConstructorDescriptor, parent: DRIWithPlatformInfo): DFunction { - val dri = parent.dri.copy(callable = Callable.from(descriptor)) + val name = descriptor.constructedClass.name.toString() + val dri = parent.dri.copy(callable = Callable.from(descriptor, name)) val actual = descriptor.createSources() val isExpect = descriptor.isExpect return DFunction( dri = dri, - name = descriptor.constructedClass.name.toString(), + name = name, isConstructor = true, receiver = descriptor.extensionReceiverParameter?.let { visitReceiverParameterDescriptor(it, DRIWithPlatformInfo(dri, actual)) -- cgit