aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Kotlin/DocumentationBuildingVisitor.kt8
-rw-r--r--src/main.kt2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/Kotlin/DocumentationBuildingVisitor.kt b/src/Kotlin/DocumentationBuildingVisitor.kt
index 364c4f6c..81ac2430 100644
--- a/src/Kotlin/DocumentationBuildingVisitor.kt
+++ b/src/Kotlin/DocumentationBuildingVisitor.kt
@@ -4,13 +4,15 @@ import org.jetbrains.jet.lang.descriptors.*
import org.jetbrains.jet.lang.resolve.name.*
import org.jetbrains.jet.lang.resolve.*
-public data class DocumentationOptions(val includeNonPublic : Boolean = false)
+public data class DocumentationOptions(val includeNonPublic: Boolean = false)
class DocumentationBuildingVisitor(val context: BindingContext,
val options: DocumentationOptions,
private val worker: DeclarationDescriptorVisitor<DocumentationNode, DocumentationNode>)
: DeclarationDescriptorVisitor<DocumentationNode, DocumentationNode> {
+ val visibleToDocumentation = setOf(Visibilities.INTERNAL, Visibilities.PROTECTED, Visibilities.PUBLIC)
+
private fun visitChildren(descriptors: Collection<DeclarationDescriptor>, data: DocumentationNode) {
for (descriptor in descriptors) {
visitChild(descriptor, data)
@@ -19,7 +21,9 @@ class DocumentationBuildingVisitor(val context: BindingContext,
private fun visitChild(descriptor: DeclarationDescriptor?, data: DocumentationNode) {
if (descriptor != null && descriptor.isUserCode()) {
- if (options.includeNonPublic || descriptor !is MemberDescriptor || descriptor.getVisibility().isPublicAPI()) {
+ if (options.includeNonPublic
+ || descriptor !is MemberDescriptor
+ || descriptor.getVisibility() in visibleToDocumentation) {
descriptor.accept(this, data)
}
}
diff --git a/src/main.kt b/src/main.kt
index 24407e6a..d30f3035 100644
--- a/src/main.kt
+++ b/src/main.kt
@@ -54,7 +54,7 @@ public fun main(args: Array<String>) {
context.getPackageFragment(file)!!.fqName
}.toSet()
- context.createDocumentationModule(arguments.moduleName, module, packageSet, DocumentationOptions(true))
+ context.createDocumentationModule(arguments.moduleName, module, packageSet)
}
val timeAnalyse = System.currentTimeMillis() - startAnalyse
println("done in ${timeAnalyse / 1000} secs")