Getting started with writing scripts for DataGrip

Is there any reference documentation for the API exposed to DataGrip extensions scripts in JavaScript/Clojure/Groovy? I've rummaged through some of the examples and am trying to get a better understanding of how I can use the exposed functionality, but it has been slow going without any detailed descriptions of what is available or any ability to do bush-league debugging (print statements, alerts, logging, etc.).


I've read here

that you can edit in IDEA custom groovy scripts with all auto-completion and other neat bells and whistles. I'm probably missing some very basic thing trying to setup that environment.

I have IDEA Ultimate 2017.3 (latest), I've installed Groovy 2.4.13, i had JDK 8u152. On a fresh IDEA I've opened folder `\Users\{some_user}\.DataGrip2017.3\config\extensions\` and of course I have completion, some expressions give inspection warnings, etc.

I have groovy auto-completion but my guess is context objects are defined elsewhere (OUT, COLUMNS, etc) in some lib or so, but where? and how can I attach it so i'll be like on this picture?

Thank you


Those links are helpful, however I want to write a script that generates Kotlin using kotlinpoet (instead of just strings).  Is there documentation anywhere on how to add jars to intellij that will be made available to these scripts?