The getVariants of my PsiReference returns an array of com.intellij.codeInsight.lookup.LookupItem objects.
I done my own implementation of LookupItem and have overwritten the compareTo() method in the hope I can influence the sorting. Strangely this method is never called.
After looking into decompiled code of LookupItemUtil I saw that a new LookupItem is created unless the getObject() method returns a LookupItem itself. So I have overwritten this method to return its own instance, but still I do not achieve the expected result.
Can someone advise on how I can sort the list of code completion variants (using LookupItem)? Or using any other object type.
Appreciate any help.