diff options
author | Błażej Kardyś <bkardys@virtuslab.com> | 2019-11-06 18:38:53 +0100 |
---|---|---|
committer | Błażej Kardyś <bkardys@virtuslab.com> | 2019-11-07 08:22:03 +0100 |
commit | 0627b9dd15171db221bee2e5a6b0082aec813c98 (patch) | |
tree | c1de85d07ade23ec7856823c9e8ef780a537c081 /core/src | |
parent | 0dd2eeb3d8ec732ca23277e740157da445e82247 (diff) | |
download | dokka-0627b9dd15171db221bee2e5a6b0082aec813c98.tar.gz dokka-0627b9dd15171db221bee2e5a6b0082aec813c98.tar.bz2 dokka-0627b9dd15171db221bee2e5a6b0082aec813c98.zip |
Adding data classes synthetic functions filtering
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/kotlin/DokkaDescriptorVisitor.kt | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/core/src/main/kotlin/DokkaDescriptorVisitor.kt b/core/src/main/kotlin/DokkaDescriptorVisitor.kt index 5dad3702..c98c63dd 100644 --- a/core/src/main/kotlin/DokkaDescriptorVisitor.kt +++ b/core/src/main/kotlin/DokkaDescriptorVisitor.kt @@ -7,12 +7,11 @@ import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.links.withClass import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.impl.DeclarationDescriptorVisitorEmptyBodies -import org.jetbrains.kotlin.resolve.calls.tower.isSynthesized import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter import org.jetbrains.kotlin.resolve.scopes.MemberScope import org.jetbrains.kotlin.idea.kdoc.findKDoc -import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe -import org.jetbrains.kotlin.resolve.descriptorUtil.overriddenTreeUniqueAsSequence +import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor.Kind.FAKE_OVERRIDE +import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor.Kind.SYNTHESIZED object DokkaDescriptorVisitor : DeclarationDescriptorVisitorEmptyBodies<DocumentationNode<*>, DRI>() { override fun visitDeclarationDescriptor(descriptor: DeclarationDescriptor, parent: DRI): Nothing { @@ -101,13 +100,13 @@ object DokkaDescriptorVisitor : DeclarationDescriptorVisitorEmptyBodies<Document listOf(descriptor) ) + private val FunctionDescriptor.isSynthetic: Boolean + get() = (kind == FAKE_OVERRIDE || kind == SYNTHESIZED) && findKDoc() == null + private fun MemberScope.functions(parent: DRI): List<Function> = getContributedDescriptors(DescriptorKindFilter.FUNCTIONS) { true } .filterIsInstance<FunctionDescriptor>() - .filterNot { - it.overriddenTreeUniqueAsSequence(false).last().containingDeclaration.fqNameSafe.asString() == Any::class.qualifiedName && - it.findKDoc() == null - } + .filterNot { it.isSynthetic } .map { visitFunctionDescriptor(it, parent) } private fun MemberScope.properties(parent: DRI): List<Property> = |