private static @Nullable String selectItem(HighlighterIterator itr, SyntaxHighlighter highlighter) {
    IElementType tokenType = itr.getTokenType();
    if (tokenType == null) return null;

    TextAttributesKey[] highlights = highlighter.getTokenHighlights(tokenType);
    String s = null;
    for (int i = highlights.length - 1; i >= 0; i--) {
      if (highlights[i] != HighlighterColors.TEXT) {
        s = highlights[i].getExternalName();
        break;
      }
    }
    return s == null ? HighlighterColors.TEXT.getExternalName() : s;
  }
private static @Nullable String selectItem(HighlighterIterator itr, SyntaxHighlighter highlighter)