We would like to expose code highlighting and comp...
# scripting
p
We would like to expose code highlighting and completion via REST API for our Kotlin Scripts to be able to develop them on web. Are there any existing solutions for this?
c
You can self host the Kotlin Playground, which has both of these features. Not sure how flexible it is for your use-cases though.
p
Yes, this is the frontend part. As per my understanding kotlin-playground is working with kotlin-compiler-server. But the kotlin-compiler-server can not directly work with custom kotlin scripts, specially the ones without main function. I am not worried for the frontend part. I want to generete highlighting and completion on my backend based on the kotlin script definition on the server.
p
I recall there's an AWS Lambda function on the backend, but I don't know if its implementation is published anywhere. All I found is a list of API routes here. I'd ask on #C02B3PECK6E for some details on the backend, maybe JB will open-source it?
c
I believe it is open source somewhere already because when I asked how to make @sample work in Dokka they told me to self&host the Playground 馃
馃 1
p
Who is they and where did they tell it to you? 馃槃
c
Honestly I don't know, but it was years ago
Maybe my brain invented this?
Ah
how to use external libraries 路 Issue #119 路 JetBrains/kotlin-playground https://share.google/5fny1eXWU7slvxDTp
I'm right, you can
The instructions don't seem very clear to me, but maybe there's a more precise tutorial elsewhere
p
Cool, thanks for sharing!