A text edit represents edits that should be applied to a document.

Static methods

staticdelete(range:Range):TextEdit

Utility to create a delete edit.

Parameters:

range

A range.

Returns:

A new text edit object.

staticinsert(position:Position, newText:String):TextEdit

Utility to create an insert edit.

Parameters:

position

A position, will become an empty range.

newText

A string.

Returns:

A new text edit object.

staticreplace(range:Range, newText:String):TextEdit

Utility to create a replace edit.

Parameters:

range

A range.

newText

A string.

Returns:

A new text edit object.

staticsetEndOfLine(eol:EndOfLine):TextEdit

Utility to create an eol-edit.

Parameters:

eol

An eol-sequence

Returns:

A new text edit object.

Constructor

new(range:Range, newText:String)

Create a new TextEdit.

Parameters:

range

A range.

newText

A string.

Variables

newEol:Null<EndOfLine>

The eol-sequence used in the document.

Note that the eol-sequence will be applied to the whole document.

newText:String

The string this edit will insert.

range:Range

The range this edit applies to.