private @NotNull List<IElementType> getTokenType(@NotNull CharSequence text, int offset) {
    var lexerWrapper = getLexerWrapper(text, offset);
    int data;

    IElementType tokenType1 = null;
    IElementType tokenType2 = null;

    while (lexerWrapper.getTokenType() != null) {
      int lexerState = lexerWrapper.getState();
      data = mySegments.packData(lexerWrapper.getTokenType(), lexerState, canRestart(lexerState));
      if (tokenType1 == null && lexerWrapper.getTokenEnd() >= offset) {
        tokenType1 = mySegments.unpackTokenFromData(data);
      }
      if (lexerWrapper.getTokenEnd() >= offset + 1) {
        tokenType2 = mySegments.unpackTokenFromData(data);
        break;
      }
      lexerWrapper.advance();
    }

    return Arrays.asList(tokenType1, tokenType2);
  }
private @NotNull List<IElementType> getTokenType(@NotNull CharSequence text, int offset)