A snippet edit represents an interactive edit that is performed by the editor.

Note that a snippet edit can always be performed as a normal {@link TextEdit text edit}. This will happen when no matching editor is open or when a {@link WorkspaceEdit workspace edit} contains snippet edits for multiple files. In that case only those that match the active editor will be performed as snippet edits and the others as normal text edits.

Static methods

staticinsert(position:Position, snippet:SnippetString):SnippetTextEdit

Utility to create an insert snippet edit.

Parameters:

position

A position, will become an empty range.

snippet

A snippet string.

Returns:

A new snippet edit object.

staticreplace(range:Range, snippet:SnippetString):SnippetTextEdit

Utility to create a replace snippet edit.

Parameters:

range

A range.

snippet

A snippet string.

Returns:

A new snippet edit object.

Constructor

new(range:Range, snippet:SnippetString)

Create a new snippet edit.

Parameters:

range

A range.

snippet

A snippet string.

Variables

range:Range

The range this edit applies to.

snippet:SnippetString

The {@link SnippetString snippet} this edit will perform.