I create a sample Kotlin project with Gradle DSL using IntelliJ IDEA and when i create a custom gradle.kts file(named custom.gradle.kts, located at the same level as settings.gradle.kts & build.gradle.kts), IDE prompt code insight unavailable.But the code insight is available in build.gradle.kts and settings.gradle.kts. Although the script can run normally, it is too unfriendly for script writing.
I tried to invalidate the cache or add to standalone scripts, those are not working for me.
If you want to move some of your Gradle scripting code to another Kotlin script file, you should do it in a precompiled script plugin.
I wrote an answer explaining exactly how to do this earlier in the year.