提交 ff703d81 编写于 作者: B Benjamin Pasero

state - ensure to create state folder

上级 0048ef82
......@@ -70,13 +70,17 @@ export class BrowserStorageService extends Disposable implements IStorageService
private async doInitialize(payload: IWorkspaceInitializationPayload): Promise<void> {
// Ensure state folder exists
const stateRoot = joinPath(this.environmentService.userRoamingDataHome, 'state');
await this.fileService.createFolder(stateRoot);
// Workspace Storage
this.workspaceStorageFile = joinPath(this.environmentService.userRoamingDataHome, 'state', `${payload.id}.json`);
this.workspaceStorageFile = joinPath(stateRoot, `${payload.id}.json`);
this.workspaceStorage = new Storage(this._register(new FileStorageDatabase(this.workspaceStorageFile, this.fileService)));
this._register(this.workspaceStorage.onDidChangeStorage(key => this._onDidChangeStorage.fire({ key, scope: StorageScope.WORKSPACE })));
// Global Storage
this.globalStorageFile = joinPath(this.environmentService.userRoamingDataHome, 'state', 'global.json');
this.globalStorageFile = joinPath(stateRoot, 'global.json');
this.globalStorage = new Storage(this._register(new FileStorageDatabase(this.globalStorageFile, this.fileService)));
this._register(this.globalStorage.onDidChangeStorage(key => this._onDidChangeStorage.fire({ key, scope: StorageScope.GLOBAL })));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册