ExtensionsRegistry only tracks extension points

This commit is contained in:
Alex Dima
2016-10-26 20:58:15 +02:00
parent ccfaf9796a
commit d801542057
15 changed files with 134 additions and 141 deletions

View File

@@ -11,7 +11,6 @@ import Severity from 'vs/base/common/severity';
import { TPromise } from 'vs/base/common/winjs.base';
import { AbstractExtensionService, ActivatedExtension } from 'vs/platform/extensions/common/abstractExtensionService';
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
import { ExtensionsRegistry } from 'vs/platform/extensions/common/extensionsRegistry';
import { ExtHostStorage } from 'vs/workbench/api/node/extHostStorage';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IThreadService } from 'vs/workbench/services/thread/common/threadService';
@@ -119,8 +118,9 @@ 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, args: { _serviceBrand: any; workspaceStoragePath: string; }) {
constructor(availableExtensions: IExtensionDescription[], threadService: IThreadService, telemetryService: ITelemetryService, args: { _serviceBrand: any; workspaceStoragePath: string; }) {
super(false);
this._registry.registerExtensions(availableExtensions);
this._threadService = threadService;
this._storage = new ExtHostStorage(threadService);
this._proxy = this._threadService.get(MainContext.MainProcessExtensionService);
@@ -128,6 +128,14 @@ export class ExtHostExtensionService extends AbstractExtensionService<ExtHostExt
this._workspaceStoragePath = args.workspaceStoragePath;
}
public getAllExtensionDescriptions(): IExtensionDescription[] {
return this._registry.getAllExtensionDescriptions();
}
public getExtensionDescription(extensionId: string): IExtensionDescription {
return this._registry.getExtensionDescription(extensionId);
}
public $localShowMessage(severity: Severity, msg: string): void {
switch (severity) {
case Severity.Error:
@@ -179,7 +187,7 @@ export class ExtHostExtensionService extends AbstractExtensionService<ExtHostExt
}
public registrationDone(): void {
this._proxy.$onExtensionHostReady(ExtensionsRegistry.getAllExtensionDescriptions()).then(() => {
this._proxy.$onExtensionHostReady(this._registry.getAllExtensionDescriptions()).then(() => {
// Wait for the main process to acknowledge its receival of the extensions descriptions
// before allowing extensions to be activated
this._triggerOnReady();