From 1d213c8b3aa7abeb75665d1c77adcf2e6071e0f6 Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Fri, 17 Apr 2020 12:41:26 +0200 Subject: Add parameters tag filtering for primary constructor in constructors page --- .../DefaultDescriptorToDocumentableTranslator.kt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'plugins/base') diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index fd6fe6bb..757a84e1 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -5,9 +5,7 @@ import org.jetbrains.dokka.links.Callable import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.withClass import org.jetbrains.dokka.model.* -import org.jetbrains.dokka.model.doc.Constructor -import org.jetbrains.dokka.model.doc.Description -import org.jetbrains.dokka.model.doc.DocumentationNode +import org.jetbrains.dokka.model.doc.* import org.jetbrains.dokka.model.properties.PropertyContainer import org.jetbrains.dokka.pages.PlatformData import org.jetbrains.dokka.parsers.MarkdownParser @@ -342,18 +340,18 @@ private class DokkaDescriptorVisitor( map = PlatformDependent.from(it.map.map { Pair( it.key, - it.value.copy(children = it.value.children.find { it is Constructor }?.root?.let { + it.value.copy(children = (it.value.children.find { it is Constructor }?.root?.let { constructor -> listOf( - Description(it) + Description(constructor) ) - } ?: emptyList()) + } ?: emptyList()) + it.value.children.filterIsInstance()) ) }), - expect = it.expect?.copy(children = it.expect?.children?.find { it is Constructor }?.root?.let { + expect = it.expect?.copy(children = (it.expect?.children?.find { it is Constructor }?.root?.let { constructor -> listOf( - Description(it) + Description(constructor) ) - } ?: emptyList()) + } ?: emptyList()) + it.expect!!.children.filterIsInstance()) ) } else { it -- cgit