aboutsummaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorBłażej Kardyś <bkardys@virtuslab.com>2019-11-06 18:38:53 +0100
committerBłażej Kardyś <bkardys@virtuslab.com>2019-11-07 08:22:03 +0100
commit0627b9dd15171db221bee2e5a6b0082aec813c98 (patch)
treec1de85d07ade23ec7856823c9e8ef780a537c081 /core/src
parent0dd2eeb3d8ec732ca23277e740157da445e82247 (diff)
downloaddokka-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.kt13
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> =