boolean (GrString literal, int startOffset, int endOffset) { TextRange selectionRange = new TextRange(startOffset, endOffset); GrStringInjection[] injections = literal.getInjections(); for (GrStringInjection injection : injections) { TextRange range = injection.getTextRange(); if (!selectionRange.contains(range) && !range.contains(selectionRange) && range.intersects(selectionRange)) { return true; } } return false; }