aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/translators
diff options
context:
space:
mode:
authorMarcin Aman <marcin.aman@gmail.com>2021-08-27 13:45:27 +0200
committerMarcin Aman <marcin.aman@gmail.com>2021-08-27 13:45:27 +0200
commit459a0005824de412ff7d4472c1eb4d6fb7c2a7cc (patch)
tree0ccdbf1d2b5b7e3ad54f70df9284d63a29f058f5 /plugins/base/src/main/kotlin/translators
parent8e1848edfa24acb6b12fad067a6cedbb7be0426b (diff)
downloaddokka-459a0005824de412ff7d4472c1eb4d6fb7c2a7cc.tar.gz
dokka-459a0005824de412ff7d4472c1eb4d6fb7c2a7cc.tar.bz2
dokka-459a0005824de412ff7d4472c1eb4d6fb7c2a7cc.zip
Restore language level to 1.4
Diffstat (limited to 'plugins/base/src/main/kotlin/translators')
-rw-r--r--plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt4
-rw-r--r--plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt3
2 files changed, 5 insertions, 2 deletions
diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
index 88dde911..0cd99f08 100644
--- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
+++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt
@@ -62,6 +62,7 @@ import org.jetbrains.kotlin.resolve.source.PsiSourceFile
import org.jetbrains.kotlin.types.*
import org.jetbrains.kotlin.types.typeUtil.immediateSupertypes
import org.jetbrains.kotlin.types.typeUtil.isAnyOrNullableAny
+import org.jetbrains.kotlin.util.firstNotNullResult
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
import java.nio.file.Paths
@@ -891,7 +892,8 @@ private class DokkaDescriptorVisitor(
private fun DeclarationDescriptor.getJavaDocs() = (this as? CallableDescriptor)
?.overriddenDescriptors
?.mapNotNull { it.findPsi() as? PsiNamedElement }
- ?.firstNotNullOfOrNull { javadocParser.parseDocumentation(it) }
+ ?.firstOrNull()
+ ?.let { javadocParser.parseDocumentation(it) }
private suspend fun ClassDescriptor.companion(dri: DRIWithPlatformInfo): DObject? = companionObjectDescriptor?.let {
objectDescriptor(it, dri)
diff --git a/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt b/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt
index 2d300ea8..bd54eedd 100644
--- a/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt
+++ b/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt
@@ -3,12 +3,13 @@ package org.jetbrains.dokka.base.translators.documentables
import org.jetbrains.dokka.model.doc.*
import org.jetbrains.dokka.model.withDescendants
import org.jetbrains.dokka.pages.*
+import org.jetbrains.kotlin.util.firstNotNullResult
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
fun firstParagraphBrief(docTag: DocTag): DocTag? =
when(docTag){
is P -> docTag
- is CustomDocTag -> docTag.children.firstNotNullOfOrNull { firstParagraphBrief(it) }
+ is CustomDocTag -> docTag.children.firstNotNullResult { firstParagraphBrief(it) }
is Text -> docTag
else -> null
}