mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-27 12:04:04 +01:00
Make sure API team is aware of changes to contributes too (#294624)
This commit is contained in:
@@ -25,6 +25,9 @@ import * as tsb from './tsb/index.ts';
|
||||
import sourcemaps from 'gulp-sourcemaps';
|
||||
|
||||
|
||||
import { extractExtensionPointNamesFromFile } from './extractExtensionPoints.ts';
|
||||
|
||||
|
||||
// --- gulp-tsb: compile and transpile --------------------------------
|
||||
|
||||
const reporter = createReporter();
|
||||
@@ -351,6 +354,49 @@ export const compileApiProposalNamesTask = task.define('compile-api-proposal-nam
|
||||
.pipe(apiProposalNamesReporter.end(true));
|
||||
});
|
||||
|
||||
function generateExtensionPointNames() {
|
||||
const collectedNames: string[] = [];
|
||||
|
||||
const input = es.through();
|
||||
const output = input
|
||||
.pipe(es.through(function (file: File) {
|
||||
const contents = file.contents?.toString('utf-8');
|
||||
if (contents && contents.includes('registerExtensionPoint')) {
|
||||
const sourceFile = ts.createSourceFile(file.path, contents, ts.ScriptTarget.Latest, true);
|
||||
collectedNames.push(...extractExtensionPointNamesFromFile(sourceFile));
|
||||
}
|
||||
}, function () {
|
||||
collectedNames.sort();
|
||||
const content = JSON.stringify(collectedNames, undefined, '\t') + '\n';
|
||||
this.emit('data', new File({
|
||||
path: 'vs/workbench/services/extensions/common/extensionPoints.json',
|
||||
contents: Buffer.from(content)
|
||||
}));
|
||||
this.emit('end');
|
||||
}));
|
||||
|
||||
return es.duplex(input, output);
|
||||
}
|
||||
|
||||
const extensionPointNamesReporter = createReporter('extension-point-names');
|
||||
|
||||
export const compileExtensionPointNamesTask = task.define('compile-extension-point-names', () => {
|
||||
return gulp.src('src/vs/workbench/**/*.ts')
|
||||
.pipe(generateExtensionPointNames())
|
||||
.pipe(gulp.dest('src'))
|
||||
.pipe(extensionPointNamesReporter.end(true));
|
||||
});
|
||||
|
||||
export const watchExtensionPointNamesTask = task.define('watch-extension-point-names', () => {
|
||||
const task = () => gulp.src('src/vs/workbench/**/*.ts')
|
||||
.pipe(generateExtensionPointNames())
|
||||
.pipe(extensionPointNamesReporter.end(true));
|
||||
|
||||
return watch('src/vs/workbench/**/*.ts', { readDelay: 200 })
|
||||
.pipe(util.debounce(task))
|
||||
.pipe(gulp.dest('src'));
|
||||
});
|
||||
|
||||
export const watchApiProposalNamesTask = task.define('watch-api-proposal-names', () => {
|
||||
const task = () => gulp.src('src/vscode-dts/**')
|
||||
.pipe(generateApiProposalNames())
|
||||
|
||||
Reference in New Issue
Block a user