diff options
Diffstat (limited to 'plugins/base/src/main')
-rw-r--r-- | plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index 8588534b..7c797233 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -43,7 +43,7 @@ class DefaultPsiToDocumentableTranslator( override fun invoke(sourceSet: DokkaSourceSet, context: DokkaContext): DModule { - fun isFileInSourceRoots(file: File): Boolean { + fun isFileInSourceRoots(file: File) : Boolean { return sourceSet.sourceRoots.any { root -> file.path.startsWith(File(root.path).absolutePath) } } @@ -256,7 +256,7 @@ class DefaultPsiToDocumentableTranslator( inheritedFrom: DRI? = null ): DFunction { val dri = DRI.from(psi) - val docs = javadocParser.parseDocumentation(psi).toSourceSetDependent() + val docs = javadocParser.parseDocumentation(psi) return DFunction( dri, if (isConstructor) "<init>" else psi.name, @@ -265,13 +265,17 @@ class DefaultPsiToDocumentableTranslator( DParameter( dri.copy(target = dri.target.nextTarget()), psiParameter.name, - DocumentationNode(docs.entries.mapNotNull { it.value.children.filterIsInstance<Param>().firstOrNull { it.root.children.firstIsInstanceOrNull<DocumentationLink>()?.children?.firstIsInstanceOrNull<Text>()?.body == psiParameter.name } }).toSourceSetDependent(), + DocumentationNode( + listOfNotNull(docs.firstChildOfType<Param> { + it.firstChildOfType<DocumentationLink>() + ?.firstChildOfType<Text>()?.body == psiParameter.name + })).toSourceSetDependent(), null, getBound(psiParameter.type), setOf(sourceSetData) ) }, - docs, + docs.toSourceSetDependent(), null, PsiDocumentableSource(psi).toSourceSetDependent(), psi.getVisibility().toSourceSetDependent(), @@ -301,7 +305,6 @@ class DefaultPsiToDocumentableTranslator( ExtraModifiers.JavaOnlyModifiers.Transitive.takeIf { hasModifier(JvmModifier.TRANSITIVE) } ).toSet() - private fun Set<ExtraModifiers>.toListOfAnnotations() = map { if (it !is ExtraModifiers.JavaOnlyModifiers.Static) Annotations.Annotation(DRI("kotlin.jvm", it.name.toLowerCase().capitalize()), emptyMap()) @@ -394,7 +397,7 @@ class DefaultPsiToDocumentableTranslator( val dri = DRI.from(psi) return DProperty( dri, - psi.name!!, // TODO: Investigate if this is indeed nullable + psi.name, javadocParser.parseDocumentation(psi).toSourceSetDependent(), null, PsiDocumentableSource(psi).toSourceSetDependent(), |