From feed2016cea8650626ba53306251a3c42da63dfd Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 2 Mar 2015 18:34:05 +0100 Subject: option to exclude deprecated members from generated documentation --- src/Kotlin/DocumentationBuilder.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Kotlin/DocumentationBuilder.kt') diff --git a/src/Kotlin/DocumentationBuilder.kt b/src/Kotlin/DocumentationBuilder.kt index ddea6d6e..60f03f14 100644 --- a/src/Kotlin/DocumentationBuilder.kt +++ b/src/Kotlin/DocumentationBuilder.kt @@ -28,6 +28,7 @@ import org.jetbrains.kotlin.types.expressions.OperatorConventions public data class DocumentationOptions(val includeNonPublic: Boolean = false, val reportUndocumented: Boolean = true, val skipEmptyPackages: Boolean = true, + val skipDeprecated: Boolean = false, val sourceLinks: List) private fun isSamePackage(descriptor1: DeclarationDescriptor, descriptor2: DeclarationDescriptor): Boolean { @@ -289,7 +290,9 @@ class DocumentationBuilder(val session: ResolveSession, private fun DeclarationDescriptor.isDocumented(): Boolean { return (options.includeNonPublic || this !is MemberDescriptor - || this.getVisibility() in visibleToDocumentation) && !isDocumentationSuppressed() + || this.getVisibility() in visibleToDocumentation) && + !isDocumentationSuppressed() && + (!options.skipDeprecated || !isDeprecated()) } fun DeclarationDescriptor.isDocumentationSuppressed(): Boolean { -- cgit