I'm trying to make a custom script type, I'm runni...
# scripting
z
I'm trying to make a custom script type, I'm running into some IDE issues, but maybe those are expected? I'm trying to add a
.kanon.kts
script type. I'm able to run the script from a Run Configuration with the host project I made, but the IDE just shows red for the specific pieces of my DSL. So my ask is really, is there syntax support for this in the IDE?
image.png
What I have: • kanon-script-definition Gradle Project ◦ KanonScriptDefinition ▪︎ fileExtension = "kanon.kts" ▪︎ compilationConfiguration • defaultImports "games.studiohummingbird.kanon.*" • jvm dependenciesFromCurrentContext(wholeClasspath = true) • ide acceptedLocations Everywhere ◦ META-INF.kotlin.script.templates folder ▪︎ KanonScriptDefinition.classname (empty file) ◦ build.gradle.kts ▪︎ JVM plugin ▪︎ implementation dependencies • kotlin-scripting-common • kotlin-scripting-jvm • kotlin-scripting-compiler-embeddable • kanon-script-host Gradle Project ◦ BasicJvmScriptingHost ◦ createJvmCompilationConfigurationFromTemplateKanonScriptDefinition • IntelliJ IDEA 2025.3.2 ◦ Kotlin Scripting ▪︎ KanonScriptDefinition =>.kanon.kts • needed to add the .classname file to even get this to show up
Output when running the host program
Copy code
Executing script PrisonCell.kanon.kts
PrisonCell println kanon.kts
Paragraph(elements=[TextElement(text=asdf)])
I pulled down the example script repo from github, and the
.main.kts
files seem to have correct syntax highlighting, but the
.scriptwithdeps.kts
files also seem to be red