From 5ea34f9dba4d8d20e872c0a02d7a79d87baff5bc Mon Sep 17 00:00:00 2001 From: Benjamin Pasero Date: Wed, 25 Nov 2015 12:51:24 +0100 Subject: [PATCH] return early from confirmSave when we are in extension development mode --- extensions/vscode-api-tests/src/workspace.test.ts | 1 + .../parts/files/electron-browser/textFileServices.ts | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/extensions/vscode-api-tests/src/workspace.test.ts b/extensions/vscode-api-tests/src/workspace.test.ts index bf457f5b6f4..4cbc96827da 100644 --- a/extensions/vscode-api-tests/src/workspace.test.ts +++ b/extensions/vscode-api-tests/src/workspace.test.ts @@ -29,6 +29,7 @@ suite('workspace-namespace', () => { test('openTextDocument', () => { return workspace.openTextDocument(join(workspace.rootPath, './far.js')).then(doc => { assert.ok(doc); + assert.equal(workspace.textDocuments.length, 1); }); }); diff --git a/src/vs/workbench/parts/files/electron-browser/textFileServices.ts b/src/vs/workbench/parts/files/electron-browser/textFileServices.ts index 7179263c8d4..78a8903a4f7 100644 --- a/src/vs/workbench/parts/files/electron-browser/textFileServices.ts +++ b/src/vs/workbench/parts/files/electron-browser/textFileServices.ts @@ -63,10 +63,6 @@ export class TextFileService extends BrowserTextFileService { public beforeShutdown(): boolean | TPromise { super.beforeShutdown(); - if (!!this.contextService.getConfiguration().env.pluginDevelopmentPath) { - return false; // no veto when we are in plugin dev mode because we want to reload often - } - // Dirty files need treatment on shutdown if (this.getDirty().length) { let confirm = this.confirmSave(); @@ -156,6 +152,10 @@ export class TextFileService extends BrowserTextFileService { } public confirmSave(resource?: URI): ConfirmResult { + if (!!this.contextService.getConfiguration().env.pluginDevelopmentPath) { + return ConfirmResult.DONT_SAVE; // no veto when we are in plugin dev mode because we cannot assum we run interactive (e.g. tests) + } + let resourcesToConfirm = this.getDirty(resource); if (resourcesToConfirm.length === 0) { return ConfirmResult.DONT_SAVE;