Protected ReadonlyerrorProtected ReadonlyfileProtected ReadonlyfileProtected ReadonlylabelProtected ReadonlyloggerProtected ReadonlymessageProtected ReadonlyonProtected ReadonlyonProtected ReadonlyonProtected ReadonlyopenerProtectedsaveProtectedsaveProtectedsaveProtectedsaveProtectedshellProtected ReadonlywindowProtectedapplyOptionalwidget: WidgetThis method ensures a few things about widget:
widget.getResourceUri() actually returns a URI.widget.saveable.createSnapshot or widget.saveable.serialize is defined.widget.saveable.revert is defined.Optionalwidget: WidgetProtectedcloseOptionaldoRevert: booleanProtectedcloseOptionaloptions: SaveableWidget.CloseOptionsProtectedcreateAn event is emitted when a layout is initialized, but before the shell is attached.
Saves the document
No op if the widget is not saveable.
Optionaloptions: SaveOptionsSave sourceWidget to a new file picked by the user.
Optionaloptions: SaveOptionsProtectedsaveSave all dirty saveables when the application window loses focus.
Triggered for both onFocusChange and onWindowChange auto-save modes,
matching VSCode's behavior where a window focus loss is a superset of
editor focus loss.
ProtectedsaveSaves the current snapshot of the sourceWidget to the target file and replaces the widget with a new one that contains the snapshot content
widget to save as target.
The new URI for the widget.
ProtectedshouldProtectedshouldOptionaloptions: SaveableWidget.CloseOptionsProtectedupdateProtectedupdatewhether closing the given widget would discard changes, i.e. whether it is dirty and not saved automatically
Indicate if the document can be saved ('Save' command should be disable if not).