String (@NotNull TextRange range) { try { final Document document = myTextComponent.getDocument(); return document.getText(range.getStartOffset(), range.getLength()); } catch (BadLocationException e) { throw new RuntimeException(e); } }