diff options
-rw-r--r-- | src/Kotlin/KotlinAsJavaDocumentationBuilder.kt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Kotlin/KotlinAsJavaDocumentationBuilder.kt b/src/Kotlin/KotlinAsJavaDocumentationBuilder.kt index 3d3f0b00..b5dc47a3 100644 --- a/src/Kotlin/KotlinAsJavaDocumentationBuilder.kt +++ b/src/Kotlin/KotlinAsJavaDocumentationBuilder.kt @@ -2,11 +2,14 @@ package org.jetbrains.dokka import com.google.inject.Inject import com.intellij.psi.JavaPsiFacade +import com.intellij.psi.PsiClass import com.intellij.psi.PsiNamedElement import org.jetbrains.dokka.Kotlin.DescriptorDocumentationParser import org.jetbrains.kotlin.asJava.KotlinLightElement import org.jetbrains.kotlin.descriptors.DeclarationDescriptor +import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.psi.KtDeclaration import org.jetbrains.kotlin.psi.KtParameter import org.jetbrains.kotlin.psi.KtPropertyAccessor @@ -28,10 +31,16 @@ class KotlinAsJavaDocumentationBuilder documentationBuilder.refGraph, kotlinAsJavaDocumentationParser) - psiPackage.classes.filter { it is KotlinLightElement<*, *> }.forEach { + psiPackage.classes.filter { it is KotlinLightElement<*, *> }.filter { it.isVisibleInDocumentation() }.forEach { javaDocumentationBuilder.appendClasses(packageNode, arrayOf(it)) } } + + fun PsiClass.isVisibleInDocumentation() : Boolean { + val origin: KtDeclaration? = (this as KotlinLightElement<*, *>).getOrigin() + return origin?.hasModifier(KtTokens.INTERNAL_KEYWORD) != true && + origin?.hasModifier(KtTokens.PRIVATE_KEYWORD) != true + } } class KotlinAsJavaDocumentationParser |