mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 17:19:01 +01:00
Trying to hook up basic save for custom editors
This commit is contained in:
@@ -256,6 +256,10 @@ export class ExtHostWebviewEditor extends Disposable implements vscode.WebviewPa
|
||||
assertIsDefined(this._capabilities).editingCapability?.applyEdits(edits);
|
||||
}
|
||||
|
||||
async _onSave(): Promise<void> {
|
||||
await assertIsDefined(this._capabilities).editingCapability?.save();
|
||||
}
|
||||
|
||||
private assertNotDisposed() {
|
||||
if (this._isDisposed) {
|
||||
throw new Error('Webview is disposed');
|
||||
@@ -459,6 +463,11 @@ export class ExtHostWebviews implements ExtHostWebviewsShape {
|
||||
panel._redoEdits(edits);
|
||||
}
|
||||
|
||||
async $onSave(handle: WebviewPanelHandle): Promise<void> {
|
||||
const panel = this.getWebviewPanel(handle);
|
||||
return panel?._onSave();
|
||||
}
|
||||
|
||||
private getWebviewPanel(handle: WebviewPanelHandle): ExtHostWebviewEditor | undefined {
|
||||
return this._webviewPanels.get(handle);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user