A change to capture text edits for existing resources.

Methods

add(edit:EitherType<TextEdit, AnnotatedTextEdit>):Void

Adds a text edit.

Parameters:

edit

the text edit to add.

Available since

3.16.0 - support for annotated text edits. This is usually guarded using a client capability.

.

all():Array<EitherType<TextEdit, AnnotatedTextEdit>>

Gets all text edits for this change.

Returns:

An array of text edits.

Available since

3.16.0 - support for annotated text edits. This is usually guarded using a client capability.

.

clear():Void

Clears the edits for this change.

delete(range:Range):Void

delete(range:Range, ?annotation:EitherType<ChangeAnnotation, ChangeAnnotationIdentifier>):ChangeAnnotationIdentifier

Delete the text at the given range.

Parameters:

range

A range.

annotation

An optional annotation.

insert(position:Position, newText:String):Void

insert(position:Position, newText:String, annotation:EitherType<ChangeAnnotation, ChangeAnnotationIdentifier>):ChangeAnnotationIdentifier

Insert the given text at the given position.

Parameters:

position

A position.

newText

A string.

annotation

An optional annotation.

replace(range:Range, newText:String):Void

replace(range:Range, newText:String, ?annotation:EitherType<ChangeAnnotation, ChangeAnnotationIdentifier>):ChangeAnnotationIdentifier

Replace the given range with given text for the given resource.

Parameters:

range

A range.

newText

A string.

annotation

An optional annotation.