From 50ec3299734dd2f38ff996de483ce6c345f55d28 Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Tue, 15 Jul 2014 16:38:19 +0400 Subject: Filter non-user and non-public api --- src/Model/DocumentationBuildingVisitor.kt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Model/DocumentationBuildingVisitor.kt b/src/Model/DocumentationBuildingVisitor.kt index c21e8f7a..2d293de2 100644 --- a/src/Model/DocumentationBuildingVisitor.kt +++ b/src/Model/DocumentationBuildingVisitor.kt @@ -9,14 +9,16 @@ class DocumentationBuildingVisitor(val context: BindingContext, private val work private fun visitChildren(descriptors: Collection, data: DocumentationNode) { for (descriptor in descriptors) { - if (descriptor.isUserCode()) - descriptor.accept(this, data) + visitChild(descriptor, data) } } private fun visitChild(descriptor: DeclarationDescriptor?, data: DocumentationNode) { - if (descriptor != null && descriptor.isUserCode()) - descriptor.accept(this, data) + if (descriptor != null && descriptor.isUserCode()) { + if (descriptor !is MemberDescriptor || descriptor.getVisibility().isPublicAPI()) { + descriptor.accept(this, data) + } + } } private fun createDocumentation(descriptor: DeclarationDescriptor, data: DocumentationNode): DocumentationNode { @@ -73,10 +75,7 @@ class DocumentationBuildingVisitor(val context: BindingContext, private val work visitChildren(descriptor.getConstructors(), node) visitChild(descriptor.getClassObjectDescriptor(), node) } - val members = descriptor.getDefaultType().getMemberScope().getAllDescriptors().filter { - it !is CallableMemberDescriptor || it.isUserCode() - } - visitChildren(members, node) + visitChildren(descriptor.getDefaultType().getMemberScope().getAllDescriptors(), node) return node } -- cgit