If you want to check the current state of my Scrip...
# scripting
s
If you want to check the current state of my ScriptDef that I found this two issues, is in the Github: https://github.com/DevSrSouza/Bukkript/blob/master/script-definition/src/main/kotlin/br/com/devsrsouza/bukkript/script/definition/ScriptDef.kt
i
Are the problems appear only in IntelliJ, and everything works on runtime? If so, please try it with the newer Kotlin plugin, e.g. 1.4-M3, there are some fixes around scripting support in it.
I do not immediately see anything wrong with your code, so if the new plugin doesn't work as well, we'll probably need to debug it.
s
I test it here and its working at when the Host run. Just for you know, the Static dependencies resolve that I do is just for the IntelliJ, in the Host, this will be their by default, but, on IntelliJ don't, so, I check if I can find the classes if not, I put the static dependency. I will update Kotlin IntellJ plugin and compile my project with the new version to give you a feedback.
Hi @ilya.chernikov, I test here on the 1.4-M3 and this give me the same result
image.png
image.png
Hi @ilya.chernikov , if you want to test it, you can just clone the project and run
./gradlew :intellij:runIde
. For the script, is a file with the extesion
.bk.kts
. You can reproduce creating a Script with and without the annotation
@file:Script("some name")
Copy code
@file:Script("test-command")

command('test-command") {
  executor {
    sender.msg("test!")
  }
}
i
Ok, I'll try to look into it in the next few days, most likely -beginning of the next week.
Hi @SrSouza Sorry I had no time till now to look at it. But I cannot reproduce it right now. I'm running your
:intellij:runIde
just fine and have a test script from above completely resolved with navigation to definitions working properly. So I think that the problems you're facing somehow related to the JDK mismatch.
image.png
s
Try without the annotation
The issue is that the IntelliJ is only resolving dependencies when I add it on the Annotation resolver, not on
beforeParsing
i
Ah, ok, I see now.
Replacing
beforeParsing
with
beforeCompiling
solves it for me.
I'll check what is the problem with the IDE script handling at this place, but I hope it will unblock you for now.
s
Thanks, I do not test with
beforeCompiling
because I was thinking that IntelliJ could not use it, but I will.