backup and recover scratchpads for exitreason=load

This commit is contained in:
aamunger 2023-05-26 10:14:07 -07:00
parent 4cb8a48746
commit f39299b594
No known key found for this signature in database
GPG key ID: F2CA0C6303FC6B74
2 changed files with 13 additions and 13 deletions

View file

@ -197,7 +197,7 @@ export class NativeWorkingCopyBackupTracker extends WorkingCopyBackupTracker imp
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
} else {
return []; // do not backup because we are switching contexts
return modifiedWorkingCopies.filter(wc => wc.capabilities & WorkingCopyCapabilities.Scratchpad); // only backup scratchpads because we are switching contexts
}
}
}

View file

@ -602,17 +602,17 @@ suite('WorkingCopyBackupTracker (native)', function () {
test('should hot exit (reason: RELOAD, windows: multiple, empty workspace)', function () {
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT, ShutdownReason.RELOAD, true, false, false);
});
test('should NOT hot exit (reason: LOAD, windows: single, workspace)', function () {
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT, ShutdownReason.LOAD, false, true, true);
test('should hot exit (reason: LOAD, windows: single, workspace)', function () {
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT, ShutdownReason.LOAD, false, true, 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: single, empty workspace)', function () {
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT, ShutdownReason.LOAD, false, false, false);
});
test('should NOT hot exit (reason: LOAD, windows: multiple, workspace)', function () {
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT, ShutdownReason.LOAD, true, true, 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 NOT hot exit (reason: LOAD, windows: multiple, empty workspace)', function () {
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT, ShutdownReason.LOAD, true, false, true);
test('should hot exit (reason: LOAD, windows: multiple, empty workspace)', function () {
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT, ShutdownReason.LOAD, true, false, false);
});
});
@ -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 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: single, empty workspace)', function () {
return scratchpadHotExitTest.call(this, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE, ShutdownReason.LOAD, false, false, false);
});
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 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);
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);
});
});