Allow globalState to be synchronized across multiple windows (#61024)

* Allow globalState to be synchronized across multiple windows (fixes #55834)

* address some feedback
This commit is contained in:
Benjamin Pasero
2018-10-16 18:52:50 +02:00
committed by GitHub
parent c8e7e58cd0
commit 2ce9665b30
5 changed files with 74 additions and 20 deletions

View File

@@ -62,6 +62,7 @@ import { ExtHostSearch } from './extHostSearch';
import { ExtHostUrls } from './extHostUrls';
import { localize } from 'vs/nls';
import { ExtHostClipboard } from 'vs/workbench/api/node/extHostClipboard';
import { ExtHostStorage } from 'vs/workbench/api/node/extHostStorage';
export interface IExtensionApiFactory {
(extension: IExtensionDescription): typeof vscode;
@@ -94,7 +95,8 @@ export function createApiFactory(
extHostWorkspace: ExtHostWorkspace,
extHostConfiguration: ExtHostConfiguration,
extensionService: ExtHostExtensionService,
extHostLogService: ExtHostLogService
extHostLogService: ExtHostLogService,
extHostStorage: ExtHostStorage
): IExtensionApiFactory {
let schemeTransformer: ISchemeTransformer | null = null;
@@ -129,6 +131,7 @@ export function createApiFactory(
const extHostProgress = rpcProtocol.set(ExtHostContext.ExtHostProgress, new ExtHostProgress(rpcProtocol.getProxy(MainContext.MainThreadProgress)));
const exthostCommentProviders = rpcProtocol.set(ExtHostContext.ExtHostComments, new ExtHostComments(rpcProtocol, extHostCommands.converter, extHostDocuments));
const extHostOutputService = rpcProtocol.set(ExtHostContext.ExtHostOutputService, new ExtHostOutputService(initData.logsLocation, rpcProtocol));
rpcProtocol.set(ExtHostContext.ExtHostStorage, extHostStorage);
// Check that no named customers are missing
const expected: ProxyIdentifier<any>[] = Object.keys(ExtHostContext).map((key) => (<any>ExtHostContext)[key]);