提交 a7fccbbd 编写于 作者: A Alex Dima

Update proposed api as soon as extensions are scanned or fetched (fixes...

Update proposed api as soon as extensions are scanned or fetched (fixes microsoft/vscode-remote-release#431)
上级 a26ed2e1
......@@ -82,7 +82,7 @@ export abstract class CommonExtensionService extends Disposable implements IExte
protected readonly _isDev: boolean;
private readonly _extensionsMessages: Map<string, IMessage[]>;
protected readonly _allRequestedActivateEvents: { [activationEvent: string]: boolean; };
protected readonly _proposedApiController: ProposedApiController;
private readonly _proposedApiController: ProposedApiController;
private readonly _isExtensionDevHost: boolean;
protected readonly _isExtensionDevTestFromCli: boolean;
......@@ -366,6 +366,12 @@ export abstract class CommonExtensionService extends Disposable implements IExte
// --- impl
protected _checkEnableProposedApi(extensions: IExtensionDescription[]): void {
for (let extension of extensions) {
this._proposedApiController.updateEnableProposedApi(extension);
}
}
protected _doHandleExtensionPoints(affectedExtensions: IExtensionDescription[]): void {
const affectedExtensionPoints: { [extPointName: string]: boolean; } = Object.create(null);
for (let extensionDescription of affectedExtensions) {
......@@ -838,6 +844,8 @@ export abstract class AbstractExtensionService extends CommonExtensionService im
const extensionHost = this._extensionHostProcessManagers[0];
let localExtensions = await this._extensionScanner.scannedExtensions;
// enable or disable proposed API per extension
this._checkEnableProposedApi(localExtensions);
if (remoteAuthority) {
let resolvedAuthority: ResolvedAuthority;
......@@ -887,6 +895,9 @@ export abstract class AbstractExtensionService extends CommonExtensionService im
(<any>extension).extensionLocation = URI.revive(extension.extensionLocation);
});
// enable or disable proposed API per extension
this._checkEnableProposedApi(remoteEnv.extensions);
// remove UI extensions from the remote extensions
remoteEnv.extensions = remoteEnv.extensions.filter(extension => !isUIExtension(extension, this._productService, this._configurationService));
......@@ -969,7 +980,7 @@ export abstract class AbstractExtensionService extends CommonExtensionService im
for (const extension of allExtensions) {
if (this._isEnabled(extension)) {
runtimeExtensions.push(this._proposedApiController.updateEnableProposedApi(extension));
runtimeExtensions.push(extension);
}
}
......@@ -1015,7 +1026,7 @@ class ProposedApiController {
}
}
public updateEnableProposedApi(extension: IExtensionDescription): IExtensionDescription {
public updateEnableProposedApi(extension: IExtensionDescription): void {
if (this._allowProposedApiFromProduct(extension.identifier)) {
// fast lane -> proposed api is available to all extensions
// that are listed in product.json-files
......@@ -1035,7 +1046,6 @@ class ProposedApiController {
console.warn(`Extension '${extension.identifier.value}' uses PROPOSED API which is subject to change and removal without notice.`);
}
}
return extension;
}
private _allowProposedApiFromProduct(id: ExtensionIdentifier): boolean {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册