storage - change main storage service to support global and workspace storage (stubs)

This commit is contained in:
Benjamin Pasero
2021-02-14 12:01:50 +01:00
parent 05922f8a26
commit 1f8bb6d33b
11 changed files with 753 additions and 300 deletions

View File

@@ -59,7 +59,7 @@ import { localize } from 'vs/nls';
import { Schemas } from 'vs/base/common/network';
import { SnapUpdateService } from 'vs/platform/update/electron-main/updateService.snap';
import { IStorageMainService, StorageMainService } from 'vs/platform/storage/node/storageMainService';
import { GlobalStorageDatabaseChannel } from 'vs/platform/storage/node/storageIpc';
import { StorageDatabaseChannel } from 'vs/platform/storage/node/storageIpc';
import { BackupMainService } from 'vs/platform/backup/electron-main/backupMainService';
import { IBackupMainService } from 'vs/platform/backup/electron-main/backup';
import { WorkspacesHistoryMainService, IWorkspacesHistoryMainService } from 'vs/platform/workspaces/electron-main/workspacesHistoryMainService';
@@ -582,7 +582,7 @@ export class CodeApplication extends Disposable {
// Storage
const storageMainService = new StorageMainService(this.logService, this.environmentService);
services.set(IStorageMainService, storageMainService);
this.lifecycleMainService.onWillShutdown(e => e.join(storageMainService.close()));
this.lifecycleMainService.onWillShutdown(e => e.join(storageMainService.globalStorage.close()));
// Backups
const backupMainService = new BackupMainService(this.environmentService, this.configurationService, this.logService);
@@ -666,7 +666,7 @@ export class CodeApplication extends Disposable {
mainProcessElectronServer.registerChannel('webview', webviewChannel);
// Storage (main & shared process)
const storageChannel = this._register(new GlobalStorageDatabaseChannel(this.logService, accessor.get(IStorageMainService)));
const storageChannel = this._register(new StorageDatabaseChannel(this.logService, accessor.get(IStorageMainService)));
mainProcessElectronServer.registerChannel('storage', storageChannel);
sharedProcessClient.then(client => client.registerChannel('storage', storageChannel));