This commit is contained in:
Johannes Rieken 2021-11-11 17:17:21 +01:00
parent 84c9bf4ec8
commit 788d959222
No known key found for this signature in database
GPG key ID: 96634B5AF12F8798
4 changed files with 4 additions and 7 deletions

View file

@ -201,7 +201,6 @@ function apiProposalNamesGenerator() {
`${proposalNames.map(t => `\t${t[0]}: '${t[1]}'`).join(',\n')}`,
'});',
'export type ApiProposalName = keyof typeof allApiProposals;',
'export const allApiProposalNames = <readonly ApiProposalName[]><unknown>Object.keys(allApiProposals);',
'',
].join('\n');
const outFile = path.join(dtsFolder, '../vs/workbench/services/extensions/common/extensionsApiProposals.ts');

View file

@ -243,7 +243,6 @@ function apiProposalNamesGenerator() {
`${proposalNames.map(t => `\t${t[0]}: '${t[1]}'`).join(',\n')}`,
'});',
'export type ApiProposalName = keyof typeof allApiProposals;',
'export const allApiProposalNames = <readonly ApiProposalName[]><unknown>Object.keys(allApiProposals);',
'',
].join('\n');

View file

@ -34,7 +34,7 @@ import { URI } from 'vs/base/common/uri';
import { IExtensionManifestPropertiesService } from 'vs/workbench/services/extensions/common/extensionManifestPropertiesService';
import { Logger } from 'vs/workbench/services/extensions/common/extensionPoints';
import { dedupExtensions } from 'vs/workbench/services/extensions/common/extensionsUtil';
import { ApiProposalName, allApiProposalNames } from 'vs/workbench/services/extensions/common/extensionsApiProposals';
import { ApiProposalName, allApiProposals } from 'vs/workbench/services/extensions/common/extensionsApiProposals';
import { forEach } from 'vs/base/common/collections';
import { ILogService } from 'vs/platform/log/common/log';
@ -1136,14 +1136,14 @@ class ProposedApiController {
(_environmentService.isExtensionDevelopment && productService.quality !== 'stable') || // do not allow proposed API against stable builds when developing an extension
(this._envEnabledExtensions.size === 0 && Array.isArray(_environmentService.extensionEnabledProposedApi)); // always allow proposed API if --enable-proposed-api is provided without extension ID
this._productEnabledExtensions = new Map<string, string[]>();
this._productEnabledExtensions = new Map<string, ApiProposalName[]>();
// 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, allApiProposalNames.slice());
this._productEnabledExtensions.set(key, Object.keys(allApiProposals));
}
}
@ -1151,7 +1151,7 @@ class ProposedApiController {
if (productService.extensionEnabledApiProposals) {
forEach(productService.extensionEnabledApiProposals, entry => {
const proposalNames = entry.value.filter(name => {
if (!allApiProposalNames.includes(<ApiProposalName>name)) {
if (!allApiProposals[<ApiProposalName>name]) {
_logService.warn(`Extension '${key} wants API proposal '${name}' but that proposal DOES NOT EXIST.`);
return false;
}

View file

@ -9,4 +9,3 @@ export const allApiProposals = Object.freeze({
languageStatus: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatus.d.ts'
});
export type ApiProposalName = keyof typeof allApiProposals;
export const allApiProposalNames = <readonly ApiProposalName[]><unknown>Object.keys(allApiProposals);