void (@NotNull PsiElement context, int offset, @NotNull Consumer<? super String> consumer, boolean allowEmptyPrefix) { if (!allowEmptyPrefix && StringUtil.isEmpty(CompletionUtil.findJavaIdentifierPrefix(context, offset))) return; CharSequence chars = context.getContainingFile().getViewProvider().getContents(); // ?? Set<CharSequence> words = new HashSet<>(chars.length()/8); IdTableBuilding.scanWords((charSeq, charsArray, start, end) -> { if (start > offset || offset > end) { CharSequence sequence = charSeq.subSequence(start, end); String str = sequence.toString(); if (words.add(str)) consumer.accept(str); } }, chars, 0, chars.length()); }