Skip to content

Commit 7036953

Browse files
author
Benjamin Pasero
committed
storage - cleanup
1 parent 3c913dd commit 7036953

6 files changed

Lines changed: 6 additions & 17 deletions

File tree

src/vs/platform/workspace/common/workspace.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,14 @@ export class Workspace implements IWorkspace {
145145
constructor(
146146
private _id: string,
147147
folders: WorkspaceFolder[] = [],
148-
private _configuration: URI | null = null,
149-
private _ctime?: number
148+
private _configuration: URI | null = null
150149
) {
151150
this.folders = folders;
152151
}
153152

154153
update(workspace: Workspace) {
155154
this._id = workspace.id;
156155
this._configuration = workspace.configuration;
157-
this._ctime = workspace.ctime;
158156
this.folders = workspace.folders;
159157
}
160158

@@ -171,10 +169,6 @@ export class Workspace implements IWorkspace {
171169
return this._id;
172170
}
173171

174-
get ctime(): number | undefined {
175-
return this._ctime;
176-
}
177-
178172
get configuration(): URI | null {
179173
return this._configuration;
180174
}

src/vs/workbench/api/node/extHost.protocol.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export interface IEnvironment {
4949
appSettingsHome: URI;
5050
extensionDevelopmentLocationURI: URI;
5151
extensionTestsPath: string;
52-
workspaceStoragePath: string;
5352
}
5453

5554
export interface IWorkspaceData {

src/vs/workbench/api/node/extHostExtensionService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape {
9797
this._extHostLogService = extHostLogService;
9898
this._mainThreadTelemetry = extHostContext.getProxy(MainContext.MainThreadTelemetry);
9999
this._storage = new ExtHostStorage(extHostContext);
100-
this._workspaceStoragePath = initData.environment.workspaceStoragePath;
100+
this._workspaceStoragePath = initData.workspace ? join(initData.environment.appSettingsHome.fsPath, 'workspaceStorage', initData.workspace.id) : undefined;
101101
this._proxy = extHostContext.getProxy(MainContext.MainThreadExtensionService);
102102
this._activator = null;
103103

src/vs/workbench/electron-browser/main.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ function createStorageService(workspaceStorageFolder: string, payload: IWorkspac
389389

390390
function createStorageLegacyService(workspaceService: IWorkspaceContextService, environmentService: IEnvironmentService): IStorageLegacyService {
391391
let workspaceId: string;
392-
let secondaryWorkspaceId: number;
393392

394393
switch (workspaceService.getWorkbenchState()) {
395394

@@ -403,7 +402,6 @@ function createStorageLegacyService(workspaceService: IWorkspaceContextService,
403402
case WorkbenchState.FOLDER:
404403
const workspace: Workspace = <Workspace>workspaceService.getWorkspace();
405404
workspaceId = workspace.folders[0].uri.toString();
406-
secondaryWorkspaceId = workspace.ctime;
407405
break;
408406

409407
// finally, if we do not have a workspace open, we need to find another identifier for the window to store
@@ -426,7 +424,7 @@ function createStorageLegacyService(workspaceService: IWorkspaceContextService,
426424
storage = window.localStorage;
427425
}
428426

429-
return new StorageLegacyService(storage, storage, workspaceId, secondaryWorkspaceId);
427+
return new StorageLegacyService(storage, storage, workspaceId);
430428
}
431429

432430
function createLogService(mainProcessClient: ElectronIPCClient, configuration: IWindowConfiguration, environmentService: IEnvironmentService): ILogService {

src/vs/workbench/services/configuration/node/configurationService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import { localize } from 'vs/nls';
3939
import { isEqual } from 'vs/base/common/resources';
4040

4141
export type IMultiFolderWorkspaceInitializationPayload = IWorkspaceIdentifier;
42-
export interface ISingleFolderWorkspaceInitializationPayload { id: string; folder: URI; }
42+
export interface ISingleFolderWorkspaceInitializationPayload { id: string; folder: ISingleFolderWorkspaceIdentifier; }
4343
export interface IEmptyWorkspaceInitializationPayload { id: string; }
4444
export type IWorkspaceInitializationPayload = IMultiFolderWorkspaceInitializationPayload | ISingleFolderWorkspaceInitializationPayload | IEmptyWorkspaceInitializationPayload;
4545

@@ -359,7 +359,7 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat
359359
configuredFolders = [{ uri: folder.toString() }];
360360
}
361361

362-
return Promise.resolve(new Workspace(singleFolder.id, toWorkspaceFolders(configuredFolders), null));
362+
return Promise.resolve(new Workspace(singleFolder.id, toWorkspaceFolders(configuredFolders)));
363363
}
364364

365365
private createEmptyWorkspace(emptyWorkspace: IEmptyWorkspaceInitializationPayload): Promise<Workspace> {

src/vs/workbench/services/extensions/electron-browser/extensionHost.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import { ILabelService } from 'vs/platform/label/common/label';
4040
import { URI } from 'vs/base/common/uri';
4141
import { Schemas } from 'vs/base/common/network';
4242
import { onUnexpectedError } from 'vs/base/common/errors';
43-
import { join } from 'path';
4443

4544
export interface IExtensionHostStarter {
4645
readonly onCrashed: Event<[number, string]>;
@@ -412,8 +411,7 @@ export class ExtensionHostProcessWorker implements IExtensionHostStarter {
412411
appRoot: this._environmentService.appRoot ? URI.file(this._environmentService.appRoot) : void 0,
413412
appSettingsHome: this._environmentService.appSettingsHome ? URI.file(this._environmentService.appSettingsHome) : void 0,
414413
extensionDevelopmentLocationURI: this._environmentService.extensionDevelopmentLocationURI,
415-
extensionTestsPath: this._environmentService.extensionTestsPath,
416-
workspaceStoragePath: this._contextService.getWorkbenchState() === WorkbenchState.EMPTY ? void 0 : join(this._environmentService.workspaceStorageHome, workspace.id)
414+
extensionTestsPath: this._environmentService.extensionTestsPath
417415
},
418416
workspace: this._contextService.getWorkbenchState() === WorkbenchState.EMPTY ? null : {
419417
configuration: workspace.configuration,

0 commit comments

Comments
 (0)