Hi, is it possible to have syntax-highlighting and...
# scripting
s
Hi, is it possible to have syntax-highlighting and auto-completion of custom scripts also in Eclipse IDE?
s
Yes! By Custom Scripts you mean your own Script Definition, right? There are couple ways of doing that but the two that I usually use is: IntelliJ plugin and kotlin script templates classpath. Kotlin Scripting IntelliJ Classpaht, I don't recall if there is any oficial documentation with a good example of how doing that, but this is the "docs" that Danger Kotlin has: https://github.com/danger/kotlin#autocomplete-and-syntax-highlighting-in-intellij-idea-or-android-studio for IntelliJ plugin that would not require to have the Jar File that contains the script definition in your machine: • ScriptDefinitionProvider: https://github.com/DevSrSouza/KotlinBukkitAPI-Tooling/blob/master/src/main/kotlin/[…]nbukkitapi/tooling/bukkript/BukkriptScriptDefinitionProvider.kt • plugin.xml: https://github.com/DevSrSouza/KotlinBukkitAPI-Tooling/blob/master/src/main/resources/META-INF/plugin.xml#L29 • embended script definition in the IntelliJ plugin: https://github.com/DevSrSouza/KotlinBukkitAPI-Tooling/blob/master/build.gradle.kts#L24 So here in my intellij plugin I embed the script defintion on the Plugin, only issue with that a long run is that, if your script definition change you had to update the IntelliJ Plugin. I suppose there is a better way of doing that, for example by dowloading the latest version of the script definition on your Github Release page.
s
Thanks for the answer! However, I'm slightly confused that you're talking about IntelliJ plugins. Did you realize my question was about Eclipse actually?
s
Oh... no, I did not realize, sorry hahaha. Does main kts supports in Eclipse? It is a custom script definition that has oficial support in Kotlin IntelliJ plugin, so if works the same way as IntelliJ, I think you can look into the Eclipse Kotlin Plugin source code to understand and try to replicate. If main kts is not supported, I don't think that there is a way for achieving that and probably will not have in the near future