Skip to content

Commit

Permalink
remove enableProposedApi from extension description, #131165
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Nov 22, 2021
1 parent 00e466b commit 19d722b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 15 deletions.
5 changes: 0 additions & 5 deletions src/vs/platform/extensions/common/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,6 @@ export interface IExtensionManifest {
readonly repository?: { url: string; };
readonly bugs?: { url: string; };
readonly enabledApiProposals?: readonly string[];
/** @deprecated */
readonly enableProposedApi?: boolean;
readonly api?: string;
readonly scripts?: { [key: string]: string; };
readonly capabilities?: IExtensionCapabilities;
Expand Down Expand Up @@ -348,9 +346,6 @@ export interface IExtensionDescription extends IExtensionManifest {
readonly isUserBuiltin: boolean;
readonly isUnderDevelopment: boolean;
readonly extensionLocation: URI;

/** @deprecated */
enableProposedApi?: boolean;
}

export function isLanguagePackExtension(manifest: IExtensionManifest): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1197,9 +1197,6 @@ class ProposedApiController {
}

extension.enabledApiProposals = productEnabledProposals;

// todo@jrieken REMOVE, legacy flag is turned on
extension.enableProposedApi = true;
return;
}

Expand All @@ -1209,11 +1206,10 @@ class ProposedApiController {
return;
}

if (!extension.isBuiltin && (extension.enableProposedApi || isNonEmptyArray(extension.enabledApiProposals))) {
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`);
extension.enabledApiProposals = [];
extension.enableProposedApi = false;
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/vs/workbench/services/extensions/common/extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export const nullExtensionDescription = Object.freeze(<IExtensionDescription>{
name: 'Null Extension Description',
version: '0.0.0',
publisher: 'vscode',
enableProposedApi: false,
engines: { vscode: '' },
extensionLocation: URI.parse('void:location'),
isBuiltin: false,
Expand Down Expand Up @@ -135,10 +134,10 @@ export interface IExtensionHost {
}

export function isProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): boolean {
if (extension.enabledApiProposals?.includes(proposal)) {
return true;
if (!extension.enabledApiProposals) {
return false;
}
return Boolean(extension.enableProposedApi);
return extension.enabledApiProposals.includes(proposal);
}

export function checkProposedApiEnabled(extension: IExtensionDescription, proposal: ApiProposalName): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,6 @@ export interface IRelaxedExtensionDescription {
vscode: string;
};
main?: string;
enableProposedApi?: boolean;
}

class ExtensionManifestValidator extends ExtensionManifestHandler {
Expand Down

0 comments on commit 19d722b

Please sign in to comment.