List<LookupElement> (@NotNull PsiFileSystemItem pyPackage, @NotNull PsiElement location, @Nullable final Set<? super String> existingNames) { final List<PsiElement> elements = new ArrayList<>(); processImplicitPackageMembers(pyPackage, location, null, any -> true, results -> { elements.addAll(ResolveResultList.getElements(results)); return true; }); return ContainerUtil.mapNotNull(elements, element -> { if (element instanceof PsiFileSystemItem) { return buildFileLookupElement(location.getContainingFile(), (PsiFileSystemItem)element, existingNames); } else if (element instanceof PsiNamedElement) { return LookupElementBuilder.createWithIcon((PsiNamedElement)element); } return null; }); }