LookupElement[] (@NotNull final ScopeOwner parentScope) { Set<LookupElement> items = new LinkedHashSet<>(); final Collection<String> usedNames = PyUtil.collectUsedNames(parentScope); for (String name : usedNames) { if (name != null) items.add(LookupElementBuilder.create(name)); } return items.toArray(LookupElement.EMPTY_ARRAY); }