Working on hooking up revert properly for custom editors

This commit is contained in:
Matt Bierner
2019-11-21 20:27:47 -08:00
parent f515fdcfe5
commit 9b89cca38e
5 changed files with 29 additions and 18 deletions

View File

@@ -273,8 +273,8 @@ export class MainThreadWebviews extends Disposable implements extHostProtocol.Ma
const model = await this._customEditorService.models.loadOrCreate(webviewInput.getResource(), webviewInput.viewType);
model.onUndo(edit => { this._proxy.$undoEdits(handle, [edit]); });
model.onRedo(edit => { this._proxy.$redoEdits(handle, [edit]); });
model.onUndo(edits => { this._proxy.$undoEdits(handle, edits); });
model.onRedo(edits => { this._proxy.$redoEdits(handle, edits); });
model.onWillSave(e => { e.waitUntil(this._proxy.$onSave(handle)); });
webviewInput.onDispose(() => {

View File

@@ -592,8 +592,8 @@ export interface ExtHostWebviewsShape {
$onDidDisposeWebviewPanel(handle: WebviewPanelHandle): Promise<void>;
$deserializeWebviewPanel(newWebviewHandle: WebviewPanelHandle, viewType: string, title: string, state: any, position: EditorViewColumn, options: modes.IWebviewOptions & modes.IWebviewPanelOptions): Promise<void>;
$resolveWebviewEditor(resource: UriComponents, newWebviewHandle: WebviewPanelHandle, viewType: string, title: string, position: EditorViewColumn, options: modes.IWebviewOptions & modes.IWebviewPanelOptions): Promise<void>;
$undoEdits(handle: WebviewPanelHandle, edits: string[]): void;
$redoEdits(handle: WebviewPanelHandle, edits: string[]): void;
$undoEdits(handle: WebviewPanelHandle, edits: readonly any[]): void;
$redoEdits(handle: WebviewPanelHandle, edits: readonly any[]): void;
$onSave(handle: WebviewPanelHandle): Promise<void>;
}