A complex edit that will be applied in one transaction on a TextEditor. This holds a description of the edits and if the edits are valid (i.e. no overlapping regions, document was not changed in the meantime, etc.) they can be applied on a {@link TextDocument document} associated with a {@link TextEditor text editor}.
Fields
setEndOfLine(endOfLine:EndOfLine):Void
Set the end of line sequence.
@link TextDocument document}.
Parameters:
endOfLine | The new end of line for the { |
---|
replace(location:EitherType<Position, EitherType<Range, Selection>>, value:String):Void
Replace a certain text region with a new value.
You can use \r\n or \n in value
and they will be normalized to the current {@link TextDocument document}.
Parameters:
location | The range this operation should remove. |
---|---|
value | The new text this operation should insert after removing |
insert(location:Position, value:String):Void
Insert text at a location.
You can use \r\n or \n in value
and they will be normalized to the current {@link TextDocument document}.
Although the equivalent text edit can be made with {@link TextEditorEdit.replace replace}, insert
will produce a different resulting selection (it will get moved).
Parameters:
location | The position where the new text should be inserted. |
---|---|
value | The new text this operation should insert. |