LookupElement (@NotNull PsiMethod method, @NotNull PsiClass origClass) { if (method.isConstructor()) return null; // TODO support suggesting constructors PsiSubstitutor substitutor = SmartCompletionDecorator.calculateMethodReturnTypeSubstitutor(method, myExpectedType); PsiType type = substitutor.substitute(method.getReturnType()); if (!isSuitableType(type)) { return null; } return GrMainCompletionProvider.createGlobalMemberElement(method, method.getContainingClass(), false); }