File tree Expand file tree Collapse file tree
workbench/electron-browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ import * as crypto from 'crypto';
1010import * as fs from 'original-fs' ;
1111import * as arrays from 'vs/base/common/arrays' ;
1212import Uri from 'vs/base/common/uri' ;
13- import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace' ;
1413import { IEnvironmentService } from 'vs/platform/environment/common/environment' ;
1514import { IBackupService } from 'vs/platform/backup/common/backup' ;
1615
@@ -28,21 +27,12 @@ export class BackupService implements IBackupService {
2827 private fileContent : IBackupFormat ;
2928
3029 constructor (
31- @IEnvironmentService private environmentService : IEnvironmentService ,
32- @IWorkspaceContextService contextService ?: IWorkspaceContextService
30+ @IEnvironmentService private environmentService : IEnvironmentService
3331 ) {
34- // IWorkspaceContextService will not exist on the main process
35- if ( ! contextService ) {
36- return ;
37- }
38-
39- // Hot exit is disabled for empty workspaces
40- const workspace = contextService . getWorkspace ( ) ;
41- if ( ! workspace ) {
42- return ;
43- }
32+ }
4433
45- this . workspaceResource = workspace . resource ;
34+ public setCurrentWorkspace ( resource : Uri ) : void {
35+ this . workspaceResource = resource ;
4636 }
4737
4838 public getWorkspaceBackupPaths ( ) : string [ ] {
Original file line number Diff line number Diff line change @@ -247,6 +247,7 @@ export class WorkbenchShell {
247247
248248 // Backup
249249 const backupService = instantiationService . createInstance ( BackupService ) ;
250+ backupService . setCurrentWorkspace ( this . contextService . getWorkspace ( ) . resource ) ;
250251 serviceCollection . set ( IBackupService , backupService ) ;
251252
252253 // Storage
You can’t perform that action at this time.
0 commit comments