From d180633e91afd76de788a0bd1bfe75fe09f19aea Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Wed, 8 Jul 2020 11:33:28 +0200 Subject: Rename processSuperClasses to buildInheritanceInformation --- core/src/main/kotlin/links/DRI.kt | 2 -- .../DefaultDescriptorToDocumentableTranslator.kt | 14 +++++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/core/src/main/kotlin/links/DRI.kt b/core/src/main/kotlin/links/DRI.kt index 3892fc00..4a555e71 100644 --- a/core/src/main/kotlin/links/DRI.kt +++ b/core/src/main/kotlin/links/DRI.kt @@ -1,8 +1,6 @@ package org.jetbrains.dokka.links import org.jetbrains.dokka.model.ClassKind -import org.jetbrains.dokka.model.Documentable -import org.jetbrains.dokka.model.WithSupertypes /** * [DRI] stands for DokkaResourceIdentifier diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index 9ca8cdde..54bd793c 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -554,28 +554,28 @@ private class DokkaDescriptorVisitor( getDocumentation()?.toSourceSetDependent() ?: emptyMap() private fun ClassDescriptor.resolveClassDescriptionData(): ClassInfo { - tailrec fun processSuperClasses( + tailrec fun buildInheritanceInformation( inheritorClass: ClassDescriptor?, interfaces: List, level: Int = 0, - inheritanceTree: Set = emptySet() + inheritanceInformation: Set = emptySet() ): Set { - if (inheritorClass == null && interfaces.isEmpty()) return inheritanceTree + if (inheritorClass == null && interfaces.isEmpty()) return inheritanceInformation - val updatedTree = inheritanceTree + InheritanceLevel( + val updated = inheritanceInformation + InheritanceLevel( level, inheritorClass?.let { DRI.from(it) }, interfaces.map { DRI.from(it) }) val superInterfacesFromClass = inheritorClass?.getSuperInterfaces().orEmpty() - return processSuperClasses( + return buildInheritanceInformation( inheritorClass = inheritorClass?.getSuperClassNotAny(), interfaces = interfaces.flatMap { it.getSuperInterfaces() } + superInterfacesFromClass, level = level + 1, - inheritanceTree = updatedTree + inheritanceInformation = updated ) } return ClassInfo( - processSuperClasses(getSuperClassNotAny(), getSuperInterfaces()).sortedBy { it.level }, + buildInheritanceInformation(getSuperClassNotAny(), getSuperInterfaces()).sortedBy { it.level }, resolveDescriptorData() ) } -- cgit