mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-24 10:38:59 +01:00
Add backup capability for custom editors
This commit is contained in:
@@ -337,7 +337,6 @@ export class MainThreadWebviews extends Disposable implements extHostProtocol.Ma
|
||||
model.onWillSave(e => {
|
||||
e.waitUntil(this._proxy.$onSave(resource.toJSON(), viewType));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// Save as should always be implemented even if the model is readonly
|
||||
@@ -349,6 +348,11 @@ export class MainThreadWebviews extends Disposable implements extHostProtocol.Ma
|
||||
e.waitUntil(this._fileService.copy(e.resource, e.targetResource, false /* overwrite */));
|
||||
}
|
||||
});
|
||||
|
||||
if (capabilitiesSet.has(extHostProtocol.WebviewEditorCapabilities.SupportsHotExit)) {
|
||||
// TODO: Hook up hot exit / backup logic
|
||||
}
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
@@ -563,6 +563,7 @@ export interface WebviewExtensionDescription {
|
||||
|
||||
export enum WebviewEditorCapabilities {
|
||||
Editable,
|
||||
SupportsHotExit,
|
||||
}
|
||||
|
||||
export interface MainThreadWebviewsShape extends IDisposable {
|
||||
|
||||
Reference in New Issue
Block a user