List<LookupElement> () { List<LookupElement> result = new ArrayList<>(); Iterable<PsiClass> instanceClasses = JBIterable .generate(myPosition, PsiElement::getParent) .filter(PsiMember.class) .takeWhile(m -> !m.hasModifierProperty(PsiModifier.STATIC)) .filter(PsiClass.class); boolean first = true; for (PsiClass psiClass : instanceClasses) { if (!first && psiClass.getName() == null) continue; for (PsiMethod psiMethod : psiClass.getMethods()) { if (!psiMethod.hasModifierProperty(PsiModifier.STATIC) && hasAppropriateReturnType(psiMethod) && isSignatureAppropriate(psiMethod, 0, null)) { result.add(createMethodRefOnThis(psiMethod, first ? null : psiClass)); } } first = false; } return result; }