diff --git a/src/vs/workbench/browser/parts/editor/editorActions.ts b/src/vs/workbench/browser/parts/editor/editorActions.ts index 1cae01b8b040b75fe0b2985474e67b52c9b11a38..9f3f7a663bb4e603ee03752ed5da98f3466d6285 100644 --- a/src/vs/workbench/browser/parts/editor/editorActions.ts +++ b/src/vs/workbench/browser/parts/editor/editorActions.ts @@ -543,13 +543,13 @@ export class RevertAndCloseEditorAction extends Action { // first try a normal revert where the contents of the editor are restored try { - await editor.revert(group.id); + await this.editorService.revert({ editor, groupId: group.id }); } catch (error) { // if that fails, since we are about to close the editor, we accept that // the editor cannot be reverted and instead do a soft revert that just // enables us to close the editor. With this, a user can always close a // dirty editor even when reverting fails. - await editor.revert(group.id, { soft: true }); + await this.editorService.revert({ editor, groupId: group.id }, { soft: true }); } group.closeEditor(editor); diff --git a/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts b/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts index 89b598ba0affe69e165c2c7890dfceb5aba68ded..60bcbfd4ba48ab7bdb85311ddda7f51b5f6223fd 100644 --- a/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts +++ b/src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts @@ -252,7 +252,7 @@ export class PreferencesEditor extends BaseEditor { if (this.editorService.activeControl !== this) { this.focus(); } - const promise: Promise = this.input && this.input.isDirty() ? this.input.save(this.group!.id).then(editor => !!editor) : Promise.resolve(true); + const promise: Promise = this.input && this.input.isDirty() ? this.editorService.save({ editor: this.input, groupId: this.group!.id }) : Promise.resolve(true); promise.then(() => { if (target === ConfigurationTarget.USER_LOCAL) { this.preferencesService.switchSettings(ConfigurationTarget.USER_LOCAL, this.preferencesService.userSettingsResource, true);