diff --git a/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts index 1ac6c84000b6d70c080eb3529d0aa8b3ed22da19..81924fb4f5237f9efe6f906cce20d59cd5d69b49 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadWorkspace.ts @@ -44,7 +44,7 @@ export class MainThreadWorkspace implements MainThreadWorkspaceShape { @ILabelService private readonly _labelService: ILabelService ) { this._proxy = extHostContext.getProxy(ExtHostContext.ExtHostWorkspace); - this._proxy.$initializeWorkspace(this.getWorkspaceData(this._contextService.getWorkspace())); + this._contextService.getCompleteWorkspace().then(workspace => this._proxy.$initializeWorkspace(this.getWorkspaceData(workspace))); this._contextService.onDidChangeWorkspaceFolders(this._onDidChangeWorkspace, this, this._toDispose); this._contextService.onDidChangeWorkbenchState(this._onDidChangeWorkspace, this, this._toDispose); } diff --git a/src/vs/workbench/api/node/extHostExtensionService.ts b/src/vs/workbench/api/node/extHostExtensionService.ts index 2f0c9249f945833c709bca605b5d147343fc52c3..7fde2926aa09a27832378e9961e4494549d3c94e 100644 --- a/src/vs/workbench/api/node/extHostExtensionService.ts +++ b/src/vs/workbench/api/node/extHostExtensionService.ts @@ -161,6 +161,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { private readonly _mainThreadTelemetryProxy: MainThreadTelemetryShape; private readonly _mainThreadExtensionsProxy: MainThreadExtensionServiceShape; + private readonly _almostReadyToRunExtensions: Barrier; private readonly _barrier: Barrier; private readonly _registry: ExtensionDescriptionRegistry; private readonly _storage: ExtHostStorage; @@ -192,6 +193,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { this._mainThreadTelemetryProxy = this._extHostContext.getProxy(MainContext.MainThreadTelemetry); this._mainThreadExtensionsProxy = this._extHostContext.getProxy(MainContext.MainThreadExtensionService); + this._almostReadyToRunExtensions = new Barrier(); this._barrier = new Barrier(); this._registry = new ExtensionDescriptionRegistry(initData.extensions); this._storage = new ExtHostStorage(this._extHostContext); @@ -245,10 +247,12 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { private async _initialize(): Promise { try { const configProvider = await this._extHostConfiguration.getConfigProvider(); - await this._extHostWorkspace.waitForInitializeCall(); await initializeExtensionApi(this, this._extensionApiFactory, this._registry, configProvider); // Do this when extension service exists, but extensions are not being activated yet. await connectProxyResolver(this._extHostWorkspace, configProvider, this, this._extHostLogService, this._mainThreadTelemetryProxy); + this._almostReadyToRunExtensions.open(); + + await this._extHostWorkspace.waitForInitializeCall(); this._barrier.open(); } catch (err) { errors.onUnexpectedError(err); @@ -683,7 +687,7 @@ export class ExtHostExtensionService implements ExtHostExtensionServiceShape { } const authorityPrefix = remoteAuthority.substr(0, authorityPlusIndex); - await this._barrier.wait(); + await this._almostReadyToRunExtensions.wait(); await this._activateByEvent(`onResolveRemoteAuthority:${authorityPrefix}`, false); const resolver = this._resolvers[authorityPrefix];