Auto-completion in kotlin main-kts scripts which uses @file:import

It seems IntelliJ auto-completion for kotlin scripts does not work across @file:import("other-file.kts") Is that correct at the time of writing for you others as well?

I’m using kotlin 1.6.20, windows, IntelliJ 2021.2.4.

I can get auto-complete to work on main-kts files, but it won’t include anything from other imported file with @file:import. For example in this file I cannot auto-complete type of a if I say val a = sharedVar, because sharedVar is from another file:

In fact its only on a rare occasion that IntelliJ will auto-complete anything in files with @file:import

I also created a smaller sample library here with an autocomplete-fails.main.kts file: