@@ -304,8 +304,6 @@ export class NativeWorkingCopyBackupTracker extends WorkingCopyBackupTracker imp
304
304
}
305
305
306
306
private doSaveAllBeforeShutdown ( workingCopies : IWorkingCopy [ ] , reason : SaveReason ) : Promise < void > {
307
- const modifiedWorkingCopies = workingCopies ;
308
-
309
307
return this . withProgressAndCancellation ( async ( ) => {
310
308
311
309
// Skip save participants on shutdown for performance reasons
@@ -314,7 +312,7 @@ export class NativeWorkingCopyBackupTracker extends WorkingCopyBackupTracker imp
314
312
// First save through the editor service if we save all to benefit
315
313
// from some extras like switching to untitled modified editors before saving.
316
314
let result : boolean | undefined = undefined ;
317
- if ( modifiedWorkingCopies . length === this . workingCopyService . modifiedCount ) {
315
+ if ( workingCopies . length === this . workingCopyService . modifiedCount ) {
318
316
result = ( await this . editorService . saveAll ( {
319
317
includeUntitled : { includeScratchpad : true } ,
320
318
...saveOptions
@@ -324,7 +322,7 @@ export class NativeWorkingCopyBackupTracker extends WorkingCopyBackupTracker imp
324
322
// If we still have modified working copies, save those directly
325
323
// unless the save was not successful (e.g. cancelled)
326
324
if ( result !== false ) {
327
- await Promises . settled ( modifiedWorkingCopies . map ( workingCopy => workingCopy . isModified ( ) ? workingCopy . save ( saveOptions ) : Promise . resolve ( true ) ) ) ;
325
+ await Promises . settled ( workingCopies . map ( workingCopy => workingCopy . isModified ( ) ? workingCopy . save ( saveOptions ) : Promise . resolve ( true ) ) ) ;
328
326
}
329
327
} , localize ( 'saveBeforeShutdown' , "Saving editors with unsaved changes is taking a bit longer..." ) ) ;
330
328
}
0 commit comments