https://kotlinlang.org logo
Title
c

christophsturm

08/16/2018, 1:56 PM
does the kotlinc repl mode support tab completion somehow?
🇳🇴 1
n

napperley

08/16/2018, 10:56 PM
If the Kotlin REPL is used in IntelliJ then some code editor features are available (eg code completion). The terminal version of the Kotlin REPL is very primitive (crippled) compared to the IntelliJ version.
g

gildor

08/17/2018, 1:42 AM
I would recommend to use new Kotlin Scratch files features. Scratch files support full-blown code completion and all the features of Kotlin Plugin + can be executed in Repl mode
✔️ 1
c

christophsturm

08/20/2018, 11:00 AM
yeah thats great, but it would also be cool if i could just ship a repl with my app, like for example rails does
g

gildor

08/20/2018, 1:35 PM
Not sure how this related to you original question about kotlinc repl. Maybe you could explain your usecase. You can have own runtime repl in your application using Kotlin scripting and jsr-223 support, but not sure what is best way to get tooling support in this case, maybe better to share you usecase in #scripting
c

christophsturm

08/20/2018, 2:00 PM
well ruby has
irb
, and a lot of ruby apps just ship a wrapper around irb that sets the library path to their classes and starts irb. which is also possible with kotlinc, but without autocompletion its not very useful
g

gildor

08/20/2018, 2:04 PM
You can do exactly the same with scratch files, if I understood you correctly. Create Kotlin scratch, choose module and write code with class path of this module.
It’s not easily possible with raw jar, as I understand, you need a project. But probably support of this use case would be a good feature. Also at some point will be available as part of new scripting (with support of script dependencies), should work even now, but you have to configure Script definition in Idea manually, no easy way to ship script definition and limited tooling support
c

christophsturm

08/20/2018, 2:12 PM
yeah scratch files are great, but i want something that i can run from the shell, its more an admin tool than a development tool
g

gildor

08/20/2018, 3:55 PM
There are some plans for Kotlin Rep improvement including autocomplete related to improved Kotlin scripting, nothing specific for now: https://github.com/Kotlin/KEEP/blob/scripting/proposals/scripting-support.md#status-of-this-document
👍 1
c

christophsturm

08/20/2018, 4:15 PM
thanks!
g

gildor

08/21/2018, 2:08 AM
Be free to share your usecase about this feature: https://github.com/Kotlin/KEEP/issues/75