Skip to content

Commit

Permalink
Fixes #5649: Allow extension activation only after the main process a…
Browse files Browse the repository at this point in the history
…cknowledges its receival of the ext descriptions
  • Loading branch information
alexdima committed May 9, 2016
1 parent f135631 commit 9576539
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/vs/platform/extensions/common/nativeExtensionService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,11 @@ export class MainProcessExtensionService extends AbstractExtensionService<Activa

// -- called by extension host

public $onExtensionHostReady(extensionDescriptions: IExtensionDescription[], messages: IMessage[]): void {
public $onExtensionHostReady(extensionDescriptions: IExtensionDescription[], messages: IMessage[]): TPromise<void> {
ExtensionsRegistry.registerExtensions(extensionDescriptions);
messages.forEach((entry) => this._handleMessage(entry));
this._triggerOnReady();
return;
}

public $onExtensionActivated(extensionId: string): void {
Expand Down Expand Up @@ -251,7 +252,7 @@ export class ExtHostExtensionService extends AbstractExtensionService<ExtHostExt
* This class is constructed manually because it is a service, so it doesn't use any ctor injection
*/
constructor(threadService: IThreadService, telemetryService: ITelemetryService) {
super(true);
super(false);
threadService.registerRemotableInstance(ExtHostExtensionService, this);
this._threadService = threadService;
this._storage = new ExtHostStorage(threadService);
Expand Down Expand Up @@ -303,8 +304,11 @@ export class ExtHostExtensionService extends AbstractExtensionService<ExtHostExt
}

public registrationDone(messages: IMessage[]): void {
this._triggerOnReady();
this._proxy.$onExtensionHostReady(ExtensionsRegistry.getAllExtensionDescriptions(), messages);
this._proxy.$onExtensionHostReady(ExtensionsRegistry.getAllExtensionDescriptions(), messages).then(() => {
// Wait for the main process to acknowledge its receival of the extensions descriptions
// before allowing extensions to be activated
this._triggerOnReady();
});
}

// -- overwriting AbstractExtensionService
Expand Down

0 comments on commit 9576539

Please sign in to comment.