void (int tokenIndex, int offset, int tokenStart) { @NonNls StringBuilder sb = new StringBuilder(); IElementType tokenType = myLexer.getTokenType(); sb.append("Token sequence broken") .append("\n this: '").append(myLexer.getTokenText()).append("' (").append(tokenType).append(':') .append(tokenType != null ? tokenType.getLanguage() : null).append(") ").append(tokenStart).append(":") .append(myLexer.getTokenEnd()); if (tokenIndex > 0) { int prevStart = myLexStarts[tokenIndex - 1]; sb.append("\n prev: '").append(myText.subSequence(prevStart, offset)).append("' (").append(myLexTypes[tokenIndex - 1]).append(':') .append(myLexTypes[tokenIndex - 1].getLanguage()).append(") ").append(prevStart).append(":").append(offset); } int quoteStart = Math.max(tokenStart - 256, 0); int quoteEnd = Math.min(tokenStart + 256, myText.length()); sb.append("\n quote: [").append(quoteStart).append(':').append(quoteEnd) .append("] '").append(myText.subSequence(quoteStart, quoteEnd)).append('\''); LOG.error(sb.toString()); }