diff --git a/src/vs/platform/backup/electron-main/backupMainService.ts b/src/vs/platform/backup/electron-main/backupMainService.ts index 8a514000fac..80b81f4b7f8 100644 --- a/src/vs/platform/backup/electron-main/backupMainService.ts +++ b/src/vs/platform/backup/electron-main/backupMainService.ts @@ -38,9 +38,9 @@ export class BackupMainService implements IBackupMainService { public getWorkspaceBackupPaths(): string[] { const config = this.configurationService.getConfiguration(); - if (config && config.files && config.files.hotExit === HotExitConfiguration.APP_EXIT_AND_WINDOW_CLOSE) { + if (config && config.files && config.files.hotExit === HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE) { // Only non-folder windows are restored on main process launch when - // hot exit is configured as appExitAndWindowClose. + // hot exit is configured as onExitAndWindowClose. return []; } return this.backups.folderWorkspaces.slice(0); // return a copy diff --git a/src/vs/platform/files/common/files.ts b/src/vs/platform/files/common/files.ts index 3525bbcaa96..b0f5eea0285 100644 --- a/src/vs/platform/files/common/files.ts +++ b/src/vs/platform/files/common/files.ts @@ -492,8 +492,8 @@ export const AutoSaveConfiguration = { export const HotExitConfiguration = { OFF: 'off', - APP_EXIT: 'appExit', - APP_EXIT_AND_WINDOW_CLOSE: 'appExitAndWindowClose' + ON_EXIT: 'onExit', + ON_EXIT_AND_WINDOW_CLOSE: 'onExitAndWindowClose' }; export const CONTENT_CHANGE_EVENT_BUFFER_DELAY = 1000; diff --git a/src/vs/workbench/parts/files/browser/files.contribution.ts b/src/vs/workbench/parts/files/browser/files.contribution.ts index 49a0ba54d5f..aa61cf4b9f7 100644 --- a/src/vs/workbench/parts/files/browser/files.contribution.ts +++ b/src/vs/workbench/parts/files/browser/files.contribution.ts @@ -245,9 +245,9 @@ configurationRegistry.registerConfiguration({ }, 'files.hotExit': { 'type': 'string', - 'enum': [HotExitConfiguration.OFF, HotExitConfiguration.APP_EXIT, HotExitConfiguration.APP_EXIT_AND_WINDOW_CLOSE], - 'default': HotExitConfiguration.APP_EXIT, - 'description': nls.localize('hotExit', "Whether hot exit is enabled which allows changes to unsaved files to be remembered between sessions, hiding the prompt t save when exiting the editor. Selecting \"{0}\" means that hot exit will only be triggered when the application is closed (workbench.action.quit command via command pallete, keybinding of menu) and ALL windows with backups will be restored upon next launch. Selecting \"{1}\" will trigger hot exit when any FOLDER window is closed, only NON-FOLDER windows will be restored when the application is restarted (not FOLDER workspaces).", HotExitConfiguration.APP_EXIT, HotExitConfiguration.APP_EXIT_AND_WINDOW_CLOSE) + 'enum': [HotExitConfiguration.OFF, HotExitConfiguration.ON_EXIT, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE], + 'default': HotExitConfiguration.ON_EXIT, + 'description': nls.localize('hotExit', "Whether hot exit is enabled which allows changes to unsaved files to be remembered between sessions, hiding the prompt t save when exiting the editor. Selecting \"{0}\" means that hot exit will only be triggered when the application is closed (workbench.action.quit command via command pallete, keybinding of menu) and ALL windows with backups will be restored upon next launch. Selecting \"{1}\" will trigger hot exit when any FOLDER window is closed, only NON-FOLDER windows will be restored when the application is restarted (not FOLDER workspaces).", HotExitConfiguration.ON_EXIT, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE) } } }); diff --git a/src/vs/workbench/services/textfile/common/textFileService.ts b/src/vs/workbench/services/textfile/common/textFileService.ts index 48d942fed06..087dee007b3 100644 --- a/src/vs/workbench/services/textfile/common/textFileService.ts +++ b/src/vs/workbench/services/textfile/common/textFileService.ts @@ -186,8 +186,8 @@ export abstract class TextFileService implements ITextFileService { let doBackup: boolean; switch (reason) { case ShutdownReason.CLOSE: - if (this.contextService.hasWorkspace() && this.configuredHotExit === HotExitConfiguration.APP_EXIT_AND_WINDOW_CLOSE) { - doBackup = true; // backup if a folder is open and appExitAndWindowClose is configured + if (this.contextService.hasWorkspace() && this.configuredHotExit === HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE) { + doBackup = true; // backup if a folder is open and onExitAndWindowClose is configured } else if (windowCount > 1 || platform.isMacintosh) { doBackup = false; // do not backup if a window is closed that does not cause quitting of the application } else { @@ -355,12 +355,12 @@ export abstract class TextFileService implements ITextFileService { } // Hot exit - const hotExitMode = configuration && configuration.files ? configuration.files.hotExit : HotExitConfiguration.APP_EXIT; + const hotExitMode = configuration && configuration.files ? configuration.files.hotExit : HotExitConfiguration.ON_EXIT; // Handle the legacy case where hot exit was a boolean if (hotExitMode === false) { this.configuredHotExit = HotExitConfiguration.OFF; } else if (hotExitMode === true) { - this.configuredHotExit = HotExitConfiguration.APP_EXIT; + this.configuredHotExit = HotExitConfiguration.ON_EXIT; } else { this.configuredHotExit = hotExitMode; }