-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds Kotlin language tab for AWS-Lambda documentation #37494
base: main
Are you sure you want to change the base?
Conversation
🎊 PR Preview 7cdfd74 has been successfully built and deployed to https://quarkus-pr-main-37494-preview.surge.sh/version/main/guides/ |
Hey, Thanks for this work. I agree it would be nice. My fear is that, as most of the team is not familiar with Kotlin, it's going to be extremely hard to keep these samples up to date. And if we have to ping someone familiar with Kotlin every time we change some Java code in the doc, it's going to be a bit problematic. Not sure exactly what would be best. |
Very nice indeed! As to Guillaume's point, since I am likely the person that will often be called upon to review these, I'd be unhappy if that burden fell mostly on me. |
I agree with Guillaume here. Maybe I dreamed about it, but I remember seeing IntelliJ performing translation when pasting a Java code in a Kotlin file already |
@gastaldi The translation wouldn't catch the missing annotation would it ? |
I like the idea but as others stated - the maintainance and lacking testing of it is not going to be a good look over time. |
I just tested and can confirm that the same code is produced, missing the annotation. Maybe we can simply add a note in this case for Kotlin users? I know it's a PITA but it's better than maintaining several Kotlin snippets in the docs |
Thank you for the appreciation! I agree with your concerns to one extent, having outdated documentation that nobody feels comfortable mainteining is for sure worse than not having this documentation at all. On the other hand, I do think it is a bit of a shame though that many of the code snippets provided in the docs wouldn't work when directly translated to Kotlin, and there is nowhere in the documentation that explains the classic "gotchas" of working with this different language (the usual solution is either trial and error or StackOverflow) Maybe a good compromise, for now, could be to expand the "Using Kotlin" page to include some of the common solutions to try? We could describe how to handle static methods with the @JvmStatic annotation and other common issues as we discover them It would be nice if we kept the door open to have code snippets in both languages in the future though, as Kotlin is of course growing in popularity and many developers might be scared away from the lack of "first class" documentation support |
I believe that would be a good compromise. We can add stuff we have found over the years that users stumble upon |
Description
As Quarkus aims to offer first class support for Kotlin, it would be nice if the documentation was updated to offer code snippets for both Java and Kotlin.
Quite often, in fact, the Kotlin approach to do something is not a 1 to 1 translation from Java. For example, a Checked Template would look like this in Java
While in Kotlin it would require an extra annotation
Changes
The most "invasive" change of this PR is the move from
coderay
torouge
as source-highlighter, as the first doesn't supportKotlin
's syntaxPreview
To offer this code snippets, I thought about reusing the "Asciidoctor Tabs" already used for


Cli | Maven | Gradle
in various pages. Here is how it would look like:Going forwards
If the idea is well liked by the team, I'll try to create more PRs to update more of the existing documentation so that it would easier than ever to pick Kotlin as a language for Quarkus!