From e6b63f39c4dd19dbac5c7562abbcc14c72651572 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Tue, 1 Mar 2022 11:44:11 +0100 Subject: [PATCH] debt - remove all of `extensionAllowedProposedApi` --- build/gulpfile.vscode.web.js | 1 - product.json | 6 ------ src/vs/base/common/product.ts | 3 +-- src/vs/platform/product/common/product.ts | 8 +------- .../extensions/common/abstractExtensionService.ts | 13 +------------ .../extensions/common/extensionsRegistry.ts | 4 ---- 6 files changed, 3 insertions(+), 32 deletions(-) diff --git a/build/gulpfile.vscode.web.js b/build/gulpfile.vscode.web.js index 513306c89a9..8cc0e41d794 100644 --- a/build/gulpfile.vscode.web.js +++ b/build/gulpfile.vscode.web.js @@ -90,7 +90,6 @@ const createVSCodeWebProductConfigurationPatcher = (product) => { if (path.endsWith('vs/platform/product/common/product.js')) { const productConfiguration = JSON.stringify({ ...product, - extensionAllowedProposedApi: [...product.extensionAllowedProposedApi], version, commit, date: buildDate diff --git a/product.json b/product.json index 9d630f23cd7..ce759386c10 100644 --- a/product.json +++ b/product.json @@ -28,12 +28,6 @@ "reportIssueUrl": "https://github.com/microsoft/vscode/issues/new", "urlProtocol": "code-oss", "webviewContentExternalBaseUrlTemplate": "https://{{uuid}}.vscode-webview.net/insider/93a2a2fa12dd3ae0629eec01c05a28cb60ac1c4b/out/vs/workbench/contrib/webview/browser/pre/", - "extensionAllowedProposedApi": [ - "ms-vscode.vscode-js-profile-flame", - "ms-vscode.vscode-js-profile-table", - "GitHub.remotehub", - "GitHub.remotehub-insiders" - ], "builtInExtensions": [ { "name": "ms-vscode.references-view", diff --git a/src/vs/base/common/product.ts b/src/vs/base/common/product.ts index 1edc76fbe77..3898101efbd 100644 --- a/src/vs/base/common/product.ts +++ b/src/vs/base/common/product.ts @@ -138,8 +138,7 @@ export interface IProductConfiguration { readonly extensionKind?: { readonly [extensionId: string]: ('ui' | 'workspace' | 'web')[] }; readonly extensionPointExtensionKind?: { readonly [extensionPointId: string]: ('ui' | 'workspace' | 'web')[] }; readonly extensionSyncedKeys?: { readonly [extensionId: string]: string[] }; - /** @deprecated */ - readonly extensionAllowedProposedApi?: readonly string[]; + readonly extensionEnabledApiProposals?: { readonly [extensionId: string]: string[] }; readonly extensionUntrustedWorkspaceSupport?: { readonly [extensionId: string]: ExtensionUntrustedWorkspaceSupport }; readonly extensionVirtualWorkspacesSupport?: { readonly [extensionId: string]: ExtensionVirtualWorkspaceSupport }; diff --git a/src/vs/platform/product/common/product.ts b/src/vs/platform/product/common/product.ts index e22b33e6dcb..f85bba035b5 100644 --- a/src/vs/platform/product/common/product.ts +++ b/src/vs/platform/product/common/product.ts @@ -66,13 +66,7 @@ else { urlProtocol: 'code-oss', reportIssueUrl: 'https://github.com/microsoft/vscode/issues/new', licenseName: 'MIT', - licenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt', - extensionAllowedProposedApi: [ - 'ms-vscode.vscode-js-profile-flame', - 'ms-vscode.vscode-js-profile-table', - 'GitHub.remotehub', - 'GitHub.remotehub-insiders' - ], + licenseUrl: 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt' }); } } diff --git a/src/vs/workbench/services/extensions/common/abstractExtensionService.ts b/src/vs/workbench/services/extensions/common/abstractExtensionService.ts index 8f0f35b84fe..aeb23b01d1e 100644 --- a/src/vs/workbench/services/extensions/common/abstractExtensionService.ts +++ b/src/vs/workbench/services/extensions/common/abstractExtensionService.ts @@ -1170,14 +1170,6 @@ class ProposedApiController { this._productEnabledExtensions = new Map(); - // todo@jrieken this is deprecated and will be removed - // OLD world - extensions that are listed in `extensionAllowedProposedApi` get all proposals enabled - if (isNonEmptyArray(productService.extensionAllowedProposedApi)) { - for (let id of productService.extensionAllowedProposedApi) { - const key = ExtensionIdentifier.toKey(id); - this._productEnabledExtensions.set(key, Object.keys(allApiProposals)); - } - } // NEW world - product.json spells out what proposals each extension can use if (productService.extensionEnabledApiProposals) { @@ -1190,9 +1182,6 @@ class ProposedApiController { } return true; }); - if (this._productEnabledExtensions.has(key)) { - _logService.warn(`Extension '${key}' appears in BOTH 'product.json#extensionAllowedProposedApi' and 'extensionEnabledApiProposals'. The latter is more restrictive and will override the former.`); - } this._productEnabledExtensions.set(key, proposalNames); }); } @@ -1249,7 +1238,7 @@ class ProposedApiController { if (!extension.isBuiltin && isNonEmptyArray(extension.enabledApiProposals)) { // restrictive: extension cannot use proposed API in this context and its declaration is nulled - this._logService.critical(`Extension '${extension.identifier.value} CANNOT USE these API proposals '${extension.enabledApiProposals?.join(', ') ?? '*'}'. You MUST start in extension development mode or use the --enable-proposed-api command line flag`); + this._logService.critical(`Extension '${extension.identifier.value} CANNOT USE these API proposals '${extension.enabledApiProposals?.join(', ') || '*'}'. You MUST start in extension development mode or use the --enable-proposed-api command line flag`); extension.enabledApiProposals = []; } } diff --git a/src/vs/workbench/services/extensions/common/extensionsRegistry.ts b/src/vs/workbench/services/extensions/common/extensionsRegistry.ts index e5294d5304a..504f8b5eb47 100644 --- a/src/vs/workbench/services/extensions/common/extensionsRegistry.ts +++ b/src/vs/workbench/services/extensions/common/extensionsRegistry.ts @@ -577,10 +577,6 @@ schemaRegistry.registerSchema(schemaId, schema); schemaRegistry.registerSchema(productSchemaId, { properties: { - extensionAllowedProposedApi: { - type: 'array', - deprecationMessage: nls.localize('product.extensionAllowedProposedApi', "Use `extensionEnabledApiProposals` instead.") - }, extensionEnabledApiProposals: { description: nls.localize('product.extensionEnabledApiProposals', "API proposals that the respective extensions can freely use."), type: 'object',