intellij-community icon indicating copy to clipboard operation
intellij-community copied to clipboard

Kotlin auto-completion: don't show aliased Java types

Open stachenov opened this issue 2 years ago • 2 comments

https://youtrack.jetbrains.com/issue/KTIJ-14200

Types like java.lang.StringBuilder or java.lang.AssertionError often pop up in Kotlin auto completion, causing unnecessary ugly imports. Here, I’ve tried to fix it by disabling type aliases on the first auto completion attempt.

It could use some improvements, though.

Putting the list of aliased types in the fqNameUtil.kt looks inelegant. Ideally it would’ve been better to delegate it to the compiler library, but I haven’t found anything like that there.

On the second attempt those types still pop up in pretty much random order. It would’ve been better to give them a lower priority.

But it works, and to me it’s already a great help, not having to figure out which type is Kotlin and which is Java every time I see an auto-completion list pop up.

stachenov avatar Jun 19 '22 10:06 stachenov

Could you pls create a KTIJ ticket to describe problem.

vladimirdolzhenko avatar Jun 19 '22 19:06 vladimirdolzhenko

Done: https://youtrack.jetbrains.com/issue/KTIJ-22052/Auto-completion-shows-aliased-Java-types

stachenov avatar Jun 20 '22 04:06 stachenov