The files have highlighting and completion, but th...
# scripting
s
The files have highlighting and completion, but the default imports aren't being recognized by IntelliJ and are marked as red.
i
Does completion and highlighting works for the names from default imports too?
You can also try to find out the reason by looking into the idea log and selecting lines containing “[kts]” prefix.
s
Completion and highlighting work for the names used in default imports, but IDEA prompts me to import the names anyway, and only highlights/completes if the imports are present within the file itself. Presumably this is because it’s using the code and libraries on the classpath rather than the script definition.
i
It shouldn’t work like this. I’ll check.
s
I've done some more digging, and IDEA seems to be inconsistent on whether this works or not. I've co-opted @Nikky's minimal-scripting-example and modified it to resemble my configuration. I think what's going on is that IDEA doesn't update the script definition's default imports without a cache invalidation
Despite that, my project still doesn't seem to be interpreting the script definition correctly.
Nope, got it! I had to fix a compilation error, then invalidate the cache, and then it started working. Should I make a bug report on the YouTrack?
i
Yes, please. It would be helpful.