storage - introduce workspaceStorageHome to environment

This commit is contained in:
Benjamin Pasero
2018-10-17 12:52:42 +02:00
parent bc94252427
commit c2ef06ef8a
6 changed files with 11 additions and 3 deletions
+2 -1
View File
@@ -99,7 +99,8 @@ function createPaths(environmentService: IEnvironmentService): TPromise<any> {
environmentService.appSettingsHome,
environmentService.extensionsPath,
environmentService.nodeCachedDataDir,
environmentService.logsPath
environmentService.logsPath,
environmentService.workspaceStorageHome
];
return TPromise.join(paths.map(p => p && mkdirp(p))) as TPromise<any>;
@@ -103,6 +103,8 @@ export interface IEnvironmentService {
settingsSearchBuildId: number;
settingsSearchUrl: string;
workspaceStorageHome: string;
backupHome: string;
backupWorkspacesPath: string;
@@ -109,6 +109,9 @@ export class EnvironmentService implements IEnvironmentService {
@memoize
get appSettingsPath(): string { return path.join(this.appSettingsHome, 'settings.json'); }
@memoize
get workspaceStorageHome(): string { return path.join(this.appSettingsHome, 'workspaceStorage'); }
@memoize
get settingsSearchBuildId(): number { return product.settingsSearchBuildId; }
@@ -48,6 +48,7 @@ export interface IEnvironment {
appSettingsHome: URI;
extensionDevelopmentLocationURI: URI;
extensionTestsPath: string;
workspaceStorageHome: string;
}
export interface IWorkspaceData {
@@ -104,7 +104,7 @@ class ExtensionStoragePath {
}
const storageName = this._workspace.id;
const storagePath = join(this._environment.appSettingsHome.fsPath, 'workspaceStorage', storageName);
const storagePath = join(this._environment.workspaceStorageHome, storageName);
const exists = await dirExists(storagePath);
@@ -411,7 +411,8 @@ export class ExtensionHostProcessWorker implements IExtensionHostStarter {
appRoot: this._environmentService.appRoot ? URI.file(this._environmentService.appRoot) : void 0,
appSettingsHome: this._environmentService.appSettingsHome ? URI.file(this._environmentService.appSettingsHome) : void 0,
extensionDevelopmentLocationURI: this._environmentService.extensionDevelopmentLocationURI,
extensionTestsPath: this._environmentService.extensionTestsPath
extensionTestsPath: this._environmentService.extensionTestsPath,
workspaceStorageHome: this._environmentService.workspaceStorageHome
},
workspace: this._contextService.getWorkbenchState() === WorkbenchState.EMPTY ? null : {
configuration: workspace.configuration,