HighlighterIterator (@NotNull Editor editor, int offset) { HighlighterIterator iterator = editor.getHighlighter().createIterator(offset); if (iterator.atEnd()) { LOG.error("Iterator " + iterator + " ended unexpectedly right after creation"); return null; } return iterator; }