aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/base/src/main/kotlin')
-rw-r--r--plugins/base/src/main/kotlin/transformers/documentables/ReportUndocumentedTransformer.kt26
1 files changed, 19 insertions, 7 deletions
diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ReportUndocumentedTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/ReportUndocumentedTransformer.kt
index bb26ceef..7d475571 100644
--- a/plugins/base/src/main/kotlin/transformers/documentables/ReportUndocumentedTransformer.kt
+++ b/plugins/base/src/main/kotlin/transformers/documentables/ReportUndocumentedTransformer.kt
@@ -7,6 +7,7 @@ import org.jetbrains.dokka.plugability.DokkaContext
import org.jetbrains.dokka.transformers.documentation.DocumentableTransformer
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor.Kind.FAKE_OVERRIDE
+import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor.Kind.SYNTHESIZED
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
internal class ReportUndocumentedTransformer : DocumentableTransformer {
@@ -45,6 +46,10 @@ internal class ReportUndocumentedTransformer : DocumentableTransformer {
return false
}
+ if (isSynthesized(documentable, sourceSet)) {
+ return false
+ }
+
if (isPrivateOrInternalApi(documentable, sourceSet)) {
return false
}
@@ -124,16 +129,23 @@ internal class ReportUndocumentedTransformer : DocumentableTransformer {
}
private fun isFakeOverride(documentable: Documentable, sourceSet: SourceSetData): Boolean {
+ return callableMemberDescriptorOrNull(documentable, sourceSet)?.kind == FAKE_OVERRIDE
+ }
+
+ private fun isSynthesized(documentable: Documentable, sourceSet: SourceSetData): Boolean {
+ return callableMemberDescriptorOrNull(documentable, sourceSet)?.kind == SYNTHESIZED
+ }
+
+ private fun callableMemberDescriptorOrNull(
+ documentable: Documentable, sourceSet: SourceSetData
+ ): CallableMemberDescriptor? {
if (documentable is WithExpectActual) {
- val callableMemberDescriptor = documentable.sources[sourceSet]
+ return documentable.sources[sourceSet]
.safeAs<DescriptorDocumentableSource>()?.descriptor
- .safeAs<CallableMemberDescriptor>()
-
- if (callableMemberDescriptor?.kind == FAKE_OVERRIDE) {
- return true
- }
+ .safeAs()
}
- return false
+
+ return null
}
private fun isPrivateOrInternalApi(documentable: Documentable, sourceSet: SourceSetData): Boolean {