diff --git a/src/vs/workbench/electron-sandbox/sandbox.simpleservices.ts b/src/vs/workbench/electron-sandbox/sandbox.simpleservices.ts index d75f33a753602ad954a9c759f334d593cd97d2c1..7524e2cb8b387212ff1f394ac8f4a9c77f2b7584 100644 --- a/src/vs/workbench/electron-sandbox/sandbox.simpleservices.ts +++ b/src/vs/workbench/electron-sandbox/sandbox.simpleservices.ts @@ -86,11 +86,14 @@ export class SimpleNativeWorkbenchEnvironmentService implements INativeWorkbench get userDataSyncLogResource(): URI { return joinPath(this.userRoamingDataHome, 'syncLog'); } get userDataSyncHome(): URI { return joinPath(this.userRoamingDataHome, 'syncHome'); } get tmpDir(): URI { return joinPath(this.userRoamingDataHome, 'tmp'); } - get backupWorkspaceHome(): URI { return joinPath(this.userRoamingDataHome, 'Backups', 'workspace'); } get logsPath(): string { return joinPath(this.userRoamingDataHome, 'logs').path; } + get backupWorkspaceHome(): URI { return joinPath(this.userRoamingDataHome, 'Backups', 'workspace'); } + updateBackupPath(newPath: string | undefined): void { } + sessionId = this.configuration.sessionId; machineId = this.configuration.machineId; + remoteAuthority = this.configuration.remoteAuthority; filesToDiff = this.configuration.filesToDiff; filesToOpenOrCreate = this.configuration.filesToOpenOrCreate; diff --git a/src/vs/workbench/services/environment/electron-browser/environmentService.ts b/src/vs/workbench/services/environment/electron-browser/environmentService.ts index 0c74a2683033919bf7830b82e8ec298ecca50712..c91e8feedd3fec3a076fc9b64439cd617301a4eb 100644 --- a/src/vs/workbench/services/environment/electron-browser/environmentService.ts +++ b/src/vs/workbench/services/environment/electron-browser/environmentService.ts @@ -32,6 +32,7 @@ export class NativeWorkbenchEnvironmentService extends NativeEnvironmentService get userRoamingDataHome(): URI { return this.appSettingsHome.with({ scheme: Schemas.userData }); } // Do NOT! memoize as `backupPath` can change in configuration + // via the `updateBackupPath` method below get backupWorkspaceHome(): URI | undefined { if (this.configuration.backupPath) { return URI.file(this.configuration.backupPath).with({ scheme: this.userRoamingDataHome.scheme }); @@ -40,6 +41,10 @@ export class NativeWorkbenchEnvironmentService extends NativeEnvironmentService return undefined; } + updateBackupPath(newBackupPath: string | undefined): void { + this.configuration.backupPath = newBackupPath; + } + @memoize get logFile(): URI { return URI.file(join(this.logsPath, `renderer${this.configuration.windowId}.log`)); } diff --git a/src/vs/workbench/services/environment/electron-sandbox/environmentService.ts b/src/vs/workbench/services/environment/electron-sandbox/environmentService.ts index 8b634bf9e3a75f2b29e852bd075e3f8dc5c9d7be..a426aa7ad3ef301df093e905757b9ac40ec8f58e 100644 --- a/src/vs/workbench/services/environment/electron-sandbox/environmentService.ts +++ b/src/vs/workbench/services/environment/electron-sandbox/environmentService.ts @@ -33,6 +33,9 @@ export interface INativeWorkbenchEnvironmentService extends IWorkbenchEnvironmen readonly log?: string; readonly extHostLogsPath: URI; - // TODO@sbatten this should be retrieved somehow differently + // TODO@sbatten TODO@ben this should be retrieved somehow differently readonly windowMaximizedInitially?: boolean; + + // TODO@ben this is a bit ugly + updateBackupPath(newPath: string | undefined): void; } diff --git a/src/vs/workbench/services/workspaces/electron-sandbox/workspaceEditingService.ts b/src/vs/workbench/services/workspaces/electron-sandbox/workspaceEditingService.ts index 61e588e7e6b083cf892b884923c0f9028378def4..6a4cf6d99e54a177ecfb28fd151b53b3043db43f 100644 --- a/src/vs/workbench/services/workspaces/electron-sandbox/workspaceEditingService.ts +++ b/src/vs/workbench/services/workspaces/electron-sandbox/workspaceEditingService.ts @@ -170,7 +170,7 @@ export class NativeWorkspaceEditingService extends AbstractWorkspaceEditingServi await this.migrateStorage(result.workspace); // Reinitialize backup service - this.environmentService.configuration.backupPath = result.backupPath; + this.environmentService.updateBackupPath(result.backupPath); if (this.backupFileService instanceof BackupFileService) { this.backupFileService.reinitialize(); }