onDidChangeCustomDocument property
Signal that an edit has occurred inside a custom editor.
This event must be fired by your extension whenever an edit happens in a custom editor. An edit can be anything from changing some text, to cropping an image, to reordering a list. Your extension is free to define what an edit is and what data is stored on each edit.
Firing onDidChange
causes the editors to be marked as being dirty. This is cleared when the user either
saves or reverts the file.
Editors that support undo/redo must fire a CustomDocumentEditEvent
whenever an edit happens. This allows
users to undo and redo the edit using the editor's standard keyboard shortcuts. The editor will also mark
the editor as no longer being dirty if the user undoes all edits to the last saved state.
Editors that support editing but cannot use the editor's standard undo/redo mechanism must fire a CustomDocumentContentChangeEvent
.
The only way for a user to clear the dirty state of an editor that does not support undo/redo is to either
save
or revert
the file.
An editor should only ever fire CustomDocumentEditEvent
events, or only ever fire CustomDocumentContentChangeEvent
events.
Implementation
_i3.OnDidChangeCustomDocument get onDidChangeCustomDocument =>
_i5.getProperty(
this,
'onDidChangeCustomDocument',
);