aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin
diff options
context:
space:
mode:
authorvmishenev <vad-mishenev@yandex.ru>2021-11-12 13:55:11 +0300
committerGitHub <noreply@github.com>2021-11-12 13:55:11 +0300
commit0303fa827f9fea9c11fefbce1045536183ccd688 (patch)
tree59b94b76abeb6d7949694e02b51e1c4ba2a0fda8 /plugins/base/src/main/kotlin
parent4a1b8a981389a0459284ba62aa5d00cc0d44e454 (diff)
downloaddokka-0303fa827f9fea9c11fefbce1045536183ccd688.tar.gz
dokka-0303fa827f9fea9c11fefbce1045536183ccd688.tar.bz2
dokka-0303fa827f9fea9c11fefbce1045536183ccd688.zip
Store checked exceptions into `ExtraProperties` (#2222)
Diffstat (limited to 'plugins/base/src/main/kotlin')
-rw-r--r--plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
index 878d5973..e7028ef0 100644
--- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
+++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt
@@ -56,6 +56,7 @@ import org.jetbrains.kotlin.psi.psiUtil.getChildOfType
import org.jetbrains.kotlin.resolve.DescriptorUtils
import org.jetbrains.kotlin.utils.KotlinExceptionWithAttachments
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstance
+import org.jetbrains.kotlin.utils.addToStdlib.ifNotEmpty
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
import java.io.File
@@ -403,12 +404,16 @@ class DefaultPsiToDocumentableTranslator(
(psi.annotations.toList()
.toListOfAnnotations() + it.toListOfAnnotations()).toSourceSetDependent()
.toAnnotations(),
- ObviousMember.takeIf { inheritedFrom != null && inheritedFrom.isObvious }
+ ObviousMember.takeIf { inheritedFrom != null && inheritedFrom.isObvious },
+ psi.throwsList.toDriList().takeIf { it.isNotEmpty() }
+ ?.let { CheckedExceptions(it.toSourceSetDependent()) }
)
}
)
}
+ private fun PsiReferenceList.toDriList() = referenceElements.mapNotNull { it?.resolve()?.let { DRI.from(it) } }
+
private fun PsiModifierListOwner.additionalExtras() = listOfNotNull(
ExtraModifiers.JavaOnlyModifiers.Static.takeIf { hasModifier(JvmModifier.STATIC) },
ExtraModifiers.JavaOnlyModifiers.Native.takeIf { hasModifier(JvmModifier.NATIVE) },