void (@NotNull final PsiElement leafElement, @NotNull final HashSet<String> seenNames) { final Language language = leafElement.getLanguage(); SpellCheckingInspection.tokenize(leafElement, language, new TokenConsumer() { @Override public void consumeToken(PsiElement element, final String text, boolean useRename, int offset, TextRange rangeToCheck, Splitter splitter) { splitter.split(text, rangeToCheck, textRange -> { final String word = textRange.substring(text); addSeenWord(seenNames, word, language); }); } }); }