From d25b896ec692aeb35a5465b624508851c96dfd1d Mon Sep 17 00:00:00 2001 From: Ilya Ryzhenkov Date: Wed, 16 Jul 2014 00:11:04 +0400 Subject: Add DocumentationOptions to support non-public API docs (used in tests) --- src/Model/DocumentationBuildingVisitor.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/Model/DocumentationBuildingVisitor.kt') diff --git a/src/Model/DocumentationBuildingVisitor.kt b/src/Model/DocumentationBuildingVisitor.kt index 2d293de2..b544b42b 100644 --- a/src/Model/DocumentationBuildingVisitor.kt +++ b/src/Model/DocumentationBuildingVisitor.kt @@ -4,7 +4,10 @@ import org.jetbrains.jet.lang.descriptors.* import org.jetbrains.jet.lang.resolve.name.* import org.jetbrains.jet.lang.resolve.* -class DocumentationBuildingVisitor(val context: BindingContext, private val worker: DeclarationDescriptorVisitor) +public data class DocumentationOptions(val includeNonPublic : Boolean = false) +class DocumentationBuildingVisitor(val context: BindingContext, + val options: DocumentationOptions, + private val worker: DeclarationDescriptorVisitor) : DeclarationDescriptorVisitor { private fun visitChildren(descriptors: Collection, data: DocumentationNode) { @@ -15,7 +18,7 @@ class DocumentationBuildingVisitor(val context: BindingContext, private val work private fun visitChild(descriptor: DeclarationDescriptor?, data: DocumentationNode) { if (descriptor != null && descriptor.isUserCode()) { - if (descriptor !is MemberDescriptor || descriptor.getVisibility().isPublicAPI()) { + if (options.includeNonPublic || descriptor !is MemberDescriptor || descriptor.getVisibility().isPublicAPI()) { descriptor.accept(this, data) } } -- cgit