multi root - stable workspace.id

This commit is contained in:
Benjamin Pasero
2017-06-15 15:27:02 +02:00
parent a248e33622
commit 73dad2ebb9
10 changed files with 78 additions and 80 deletions

View File

@@ -58,6 +58,7 @@ export interface IEnvironment {
export interface IWorkspaceData {
id: string;
name: string;
roots: URI[];
}

View File

@@ -16,7 +16,6 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { createApiFactory, initializeExtensionApi } from 'vs/workbench/api/node/extHost.api.impl';
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
import { MainContext, MainProcessExtensionServiceShape, IWorkspaceData, IEnvironment, IInitData } from './extHost.protocol';
import { createHash } from 'crypto';
const hasOwnProperty = Object.hasOwnProperty;
@@ -130,11 +129,7 @@ class ExtensionStoragePath {
return TPromise.as(undefined);
}
// TODO@joh what to do with multiple roots?
const storageName = createHash('md5')
.update(this._workspace.roots[0].fsPath)
.update(this._workspace.id || '')
.digest('hex');
const storageName = this._workspace.id;
const storagePath = join(this._environment.appSettingsHome, 'workspaceStorage', storageName);
return dirExists(storagePath).then(exists => {