Code completion for build.gradle.kts

Does anybody know how to enable code completion in Intellij IDEA for a build script ? It worked previously, but as for now - no. I’ve created issue for Intellij, but apparently this will not bring me any result in the near future.
So, any thoughts about this ? possible causes / solutions.
and where can I write build scripts for Gradle with workable code completion if not in the IDEA ?