Skip to content

Commit f682de0

Browse files
fix
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
1 parent 34d2b3c commit f682de0

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

code/src/vs/workbench/services/extensions/common/extensionsProposedApi.ts

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,19 @@ export class ExtensionsProposedApi {
6767

6868
// warn about invalid proposal and remove them from the list
6969
if (isNonEmptyArray(extension.enabledApiProposals)) {
70-
extension.enabledApiProposals = extension.enabledApiProposals.filter(name => {
71-
const result = Boolean(allApiProposals[<ApiProposalName>name]);
72-
if (!result) {
73-
this._logService.error(`Extension '${key}' wants API proposal '${name}' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.`);
74-
}
75-
return result;
76-
});
70+
const normalizedProposals: ApiProposalName[] = [];
71+
for (const name of extension.enabledApiProposals) {
72+
const normalizedName = normalizeProposedApiName(name);
73+
const result = Boolean(allApiProposals[normalizedName]);
74+
if (!result) {
75+
this._logService.error(`Extension '${key}' wants API proposal '${name}' but that proposal DOES NOT EXIST. Likely, the proposal has been finalized (check 'vscode.d.ts') or was abandoned.`);
76+
continue;
77+
}
78+
if (!normalizedProposals.includes(normalizedName)) {
79+
normalizedProposals.push(normalizedName);
80+
}
81+
}
82+
extension.enabledApiProposals = normalizedProposals;
7783
}
7884

7985

@@ -115,6 +121,11 @@ export class ExtensionsProposedApi {
115121
}
116122
}
117123

124+
function normalizeProposedApiName(name: string): ApiProposalName {
125+
const match = /^(.+?)@\d+$/.exec(name);
126+
return (match ? match[1] : name) as ApiProposalName;
127+
}
128+
118129
class ApiProposalsMarkdowneRenderer extends Disposable implements IExtensionFeatureMarkdownRenderer {
119130

120131
readonly type = 'markdown';

0 commit comments

Comments
 (0)