boolean (TextRange rangeInText) { int[] offsets = getTokenOffsets(); int start = findTokenIndex(rangeInText.getStartOffset(), offsets, false); int end = findTokenIndex(rangeInText.getEndOffset(), offsets, true); for (int i = start; i <= end; i++) { TokenInfo token = tokens.get(i); if (token instanceof PsiToken && ((PsiToken) token).kind == TokenKind.unknown && rangeInText.containsOffset(offsets[i])) { return true; } } return false; }