void (@NotNull String text, @NotNull Consumer<? super TextRange> consumer) { int start = -1; int c; for (int i = 0; i <= text.length(); i += Character.charCount(c)) { c = i == text.length() ? -1 : text.codePointAt(i); boolean isIdentifierPart = Character.isJavaIdentifierPart(c); if (isIdentifierPart && start == -1) { start = i; } if (!isIdentifierPart && start != -1) { consumer.accept(new TextRange(start, i)); start = -1; } } }