Skip to content

Added an option to render Kotlin functions with suspend modifier#1377

Merged
kobylynskyi merged 1 commit into
kobylynskyi:mainfrom
thevietto:main
Nov 9, 2023
Merged

Added an option to render Kotlin functions with suspend modifier#1377
kobylynskyi merged 1 commit into
kobylynskyi:mainfrom
thevietto:main

Conversation

@thevietto

Copy link
Copy Markdown
Contributor

Description

Added a configuration option for Kotlin generator to render functions with suspend modifier:

when disabled:

fun sayHello(): String

when enabled:

suspend fun sayHello(): String

I know this could be solved by providing a custom Freemarker template to the config, but it seems like supporting Kotlin coroutines is something one would expect to get out of the box.


Changes were made to:

  • Codegen library - Java
  • Codegen library - Kotlin
  • Codegen library - Scala
  • Maven plugin
  • Gradle plugin
  • SBT plugin

@jxnu-liguobin

Copy link
Copy Markdown
Collaborator

It looks good, looking forward to you completing it. By the way. SBT cannot compile kotlin by default unless using third-party plugins. So you don't need to consider SBT. And I am considering removing the code related to kotlin from the sbt plugin in this library.

@thevietto

Copy link
Copy Markdown
Contributor Author

It looks good, looking forward to you completing it. By the way. SBT cannot compile kotlin by default unless using third-party plugins. So you don't need to consider SBT. And I am considering removing the code related to kotlin from the sbt plugin in this library.

thanks! Yeah I didn't touch the SBT module
codestyle is fixed, should be good now

@kobylynskyi

Copy link
Copy Markdown
Owner

Looks good! Thanks for the contribution.

@kobylynskyi kobylynskyi merged commit b76c49b into kobylynskyi:main Nov 9, 2023
@kobylynskyi kobylynskyi added this to the 5.9.0 milestone Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants