I got this working most time by return PsiElement or Strings.
But still the internal matchign algorithm is hidden.
Having an reference I return both, a member field and a constant.
public String field1;
public static final String constant1="";
in getVariants() I return both fields.
But the popup for auto-completion only shows the members. So the
static stuff is somehow filtered out.
Same applies to static methods.
So how do I get this working?