mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
tweak generation of propsal file a little bit
This commit is contained in:
@@ -223,11 +223,11 @@ function apiProposalNamesGenerator() {
|
||||
try {
|
||||
|
||||
const t1 = Date.now();
|
||||
const proposalNames: string[] = [];
|
||||
const proposalNames: [name: string, url: string][] = [];
|
||||
for (let file of fs.readdirSync(dtsFolder)) {
|
||||
const match = pattern.exec(file);
|
||||
if (match) {
|
||||
proposalNames.push(match[1]);
|
||||
proposalNames.push([match[1], `https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/${file}`]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,11 +239,11 @@ function apiProposalNamesGenerator() {
|
||||
'',
|
||||
'// THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY.',
|
||||
'',
|
||||
'const apiProposals = {',
|
||||
`${proposalNames.map(name => `\t${name}: true`).join(',\n')}`,
|
||||
'};',
|
||||
'export type ApiProposalName = keyof typeof apiProposals;',
|
||||
'export const apiProposalNames: ReadonlySet<ApiProposalName> = new Set(<ApiProposalName[]>Object.keys(apiProposals));',
|
||||
'export const allApiProposals = Object.freeze({',
|
||||
`${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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user