aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main
diff options
context:
space:
mode:
authorBłażej Kardyś <bkardys@virtuslab.com>2020-06-22 03:37:15 +0200
committerPaweł Marks <pmarks@virtuslab.com>2020-06-26 00:40:47 +0200
commitfb9a5abfc24e93b918693f78a8f555da2c5a359f (patch)
tree5769bf9d8b504476085a142eaccc9c8353421933 /plugins/base/src/main
parent370bf45d2dca5fcd71f53c71386be8667157c446 (diff)
downloaddokka-fb9a5abfc24e93b918693f78a8f555da2c5a359f.tar.gz
dokka-fb9a5abfc24e93b918693f78a8f555da2c5a359f.tar.bz2
dokka-fb9a5abfc24e93b918693f78a8f555da2c5a359f.zip
Javadoc briefs update
Diffstat (limited to 'plugins/base/src/main')
-rw-r--r--plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt15
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(),