boolean (CompletionParameters parameters, boolean searchInheritors, Collection<? extends ExpectedTypeInfo> types, Consumer<? super LookupElement> result) { boolean[] added = new boolean[1]; boolean smart = parameters.getCompletionType() == CompletionType.SMART; if (smart || parameters.getInvocationCount() <= 1) { // on second basic completion, StaticMemberProcessor will suggest those Consumer<LookupElement> consumer = e -> { added[0] = true; result.consume(smart ? JavaSmartCompletionContributor.decorate(e, types) : e); }; for (ExpectedTypeInfo info : types) { new JavaMembersGetter(info.getType(), parameters).addMembers(searchInheritors, consumer); if (!info.getType().equals(info.getDefaultType())) { new JavaMembersGetter(info.getDefaultType(), parameters).addMembers(searchInheritors, consumer); } } } return added[0]; }