saveCustomDocument

abstract fun saveCustomDocument(document: T, cancellation: CancellationToken): PromiseLike<Void?>(source)

Save a custom document.

This method is invoked by the editor when the user saves a custom editor. This can happen when the user triggers save while the custom editor is active, by commands such as save all, or by auto save if enabled.

To implement save, the implementer must persist the custom editor. This usually means writing the file data for the custom document to disk. After save completes, any associated editor instances will no longer be marked as dirty.

Parameters

document

Document to save.

cancellation

Token that signals the save is no longer required (for example, if another save was triggered).