diff options
author | Kamil Doległo <9080183+kamildoleglo@users.noreply.github.com> | 2020-11-25 13:17:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-25 13:17:51 +0100 |
commit | 3fe3a934092cd844a6e0b691c87c367b9fc4d5b3 (patch) | |
tree | 0ba15c94e832657be1c5a12ed5c00287a6a0bc5f /core/src/main/kotlin/transformers | |
parent | 78850b5786b7b2a767db1dbd7132a374b2f4f227 (diff) | |
download | dokka-3fe3a934092cd844a6e0b691c87c367b9fc4d5b3.tar.gz dokka-3fe3a934092cd844a6e0b691c87c367b9fc4d5b3.tar.bz2 dokka-3fe3a934092cd844a6e0b691c87c367b9fc4d5b3.zip |
Remove suspend from SourceToDocumentableTranslator (#1622)
* Remove suspend from SourceToDocumentableTranslator
* Introduce AsyncSourceToDocumentableTranslator
Co-authored-by: Marcin Aman <marcin.aman@gmail.com>
Diffstat (limited to 'core/src/main/kotlin/transformers')
-rw-r--r-- | core/src/main/kotlin/transformers/sources/AsyncSourceToDocumentableTranslator.kt | 15 | ||||
-rw-r--r-- | core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/core/src/main/kotlin/transformers/sources/AsyncSourceToDocumentableTranslator.kt b/core/src/main/kotlin/transformers/sources/AsyncSourceToDocumentableTranslator.kt new file mode 100644 index 00000000..19113446 --- /dev/null +++ b/core/src/main/kotlin/transformers/sources/AsyncSourceToDocumentableTranslator.kt @@ -0,0 +1,15 @@ +package org.jetbrains.dokka.transformers.sources + +import kotlinx.coroutines.runBlocking +import org.jetbrains.dokka.DokkaConfiguration +import org.jetbrains.dokka.model.DModule +import org.jetbrains.dokka.plugability.DokkaContext + +interface AsyncSourceToDocumentableTranslator : SourceToDocumentableTranslator { + suspend fun invokeSuspending(sourceSet: DokkaConfiguration.DokkaSourceSet, context: DokkaContext): DModule + + override fun invoke(sourceSet: DokkaConfiguration.DokkaSourceSet, context: DokkaContext): DModule = + runBlocking { + invokeSuspending(sourceSet, context) + } +}
\ No newline at end of file diff --git a/core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt b/core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt index 8ac59a15..2252dde3 100644 --- a/core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt +++ b/core/src/main/kotlin/transformers/sources/SourceToDocumentableTranslator.kt @@ -5,5 +5,5 @@ import org.jetbrains.dokka.model.DModule import org.jetbrains.dokka.plugability.DokkaContext interface SourceToDocumentableTranslator { - suspend fun invoke(sourceSet: DokkaSourceSet, context: DokkaContext): DModule + fun invoke(sourceSet: DokkaSourceSet, context: DokkaContext): DModule } |