RestLine (@NotNull RestLine element, @NotNull TextRange range, String newContent) { final String oldText = element.getText(); final String newText = oldText.substring(0, range.getStartOffset()) + newContent + oldText.substring(range.getEndOffset()); element.updateText(newText); return element; }