mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
hygiene
This commit is contained in:
parent
f39299b594
commit
b4940e6446
|
@ -194,10 +194,14 @@ export class NativeWorkingCopyBackupTracker extends WorkingCopyBackupTracker imp
|
|||
return modifiedWorkingCopies; // backup because after window reload, backups restore
|
||||
|
||||
case ShutdownReason.LOAD:
|
||||
if (this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY && this.filesConfigurationService.hotExitConfiguration === HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE) {
|
||||
return modifiedWorkingCopies; // backup if a folder is open and onExitAndWindowClose is configured
|
||||
if (this.contextService.getWorkbenchState() !== WorkbenchState.EMPTY) {
|
||||
if (this.filesConfigurationService.hotExitConfiguration === HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE) {
|
||||
return modifiedWorkingCopies; // backup if a folder is open and onExitAndWindowClose is configured
|
||||
} else {
|
||||
return modifiedWorkingCopies.filter(wc => wc.capabilities & WorkingCopyCapabilities.Scratchpad); // only backup scratchpads because we are switching contexts
|
||||
}
|
||||
} else {
|
||||
return modifiedWorkingCopies.filter(wc => wc.capabilities & WorkingCopyCapabilities.Scratchpad); // only backup scratchpads because we are switching contexts
|
||||
return []; // do not backup because we are switching contexts from an empty workspace
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -605,14 +605,14 @@ suite('WorkingCopyBackupTracker (native)', function () {
|
|||
test('should hot exit (reason: LOAD, windows: single, workspace)', function () {
|
||||
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT, ShutdownReason.LOAD, false, true, false);
|
||||
});
|
||||
test('should hot exit (reason: LOAD, windows: single, empty workspace)', function () {
|
||||
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT, ShutdownReason.LOAD, false, false, false);
|
||||
test('should NOT hot exit (reason: LOAD, windows: single, empty workspace)', function () {
|
||||
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT, ShutdownReason.LOAD, false, false, true);
|
||||
});
|
||||
test('should hot exit (reason: LOAD, windows: multiple, workspace)', function () {
|
||||
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT, ShutdownReason.LOAD, true, true, false);
|
||||
});
|
||||
test('should hot exit (reason: LOAD, windows: multiple, empty workspace)', function () {
|
||||
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT, ShutdownReason.LOAD, true, false, false);
|
||||
test('should NOT hot exit (reason: LOAD, windows: multiple, empty workspace)', function () {
|
||||
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT, ShutdownReason.LOAD, true, false, true);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -656,14 +656,14 @@ suite('WorkingCopyBackupTracker (native)', function () {
|
|||
test('should hot exit (reason: LOAD, windows: single, workspace)', function () {
|
||||
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE, ShutdownReason.LOAD, false, true, false);
|
||||
});
|
||||
test('should hot exit (reason: LOAD, windows: single, empty workspace)', function () {
|
||||
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE, ShutdownReason.LOAD, false, false, false);
|
||||
test('should NOT hot exit (reason: LOAD, windows: single, empty workspace)', function () {
|
||||
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE, ShutdownReason.LOAD, false, false, true);
|
||||
});
|
||||
test('should hot exit (reason: LOAD, windows: multiple, workspace)', function () {
|
||||
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE, ShutdownReason.LOAD, true, true, false);
|
||||
});
|
||||
test('should hot exit (reason: LOAD, windows: multiple, empty workspace)', function () {
|
||||
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE, ShutdownReason.LOAD, true, false, false);
|
||||
test('should NOT hot exit (reason: LOAD, windows: multiple, empty workspace)', function () {
|
||||
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE, ShutdownReason.LOAD, true, false, true);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue