提交 b04e9c8f 编写于 作者: J Johannes Rieken

💄 generate command docs

上级 504b8919
...@@ -34,23 +34,23 @@ export class MainThreadCommands implements MainThreadCommandsShape { ...@@ -34,23 +34,23 @@ export class MainThreadCommands implements MainThreadCommandsShape {
this._generateCommandsDocumentationRegistration.dispose(); this._generateCommandsDocumentationRegistration.dispose();
} }
private _generateCommandsDocumentation(): Promise<void> { private async _generateCommandsDocumentation(): Promise<void> {
return this._proxy.$getContributedCommandHandlerDescriptions().then(result => { const result = await this._proxy.$getContributedCommandHandlerDescriptions();
// add local commands
const commands = CommandsRegistry.getCommands();
for (const [id, command] of commands) {
if (command.description) {
result[id] = command.description;
}
}
// print all as markdown // add local commands
const all: string[] = []; const commands = CommandsRegistry.getCommands();
for (let id in result) { for (const [id, command] of commands) {
all.push('`' + id + '` - ' + _generateMarkdown(result[id])); if (command.description) {
result[id] = command.description;
} }
console.log(all.join('\n')); }
});
// print all as markdown
const all: string[] = [];
for (let id in result) {
all.push('`' + id + '` - ' + _generateMarkdown(result[id]));
}
console.log(all.join('\n'));
} }
$registerCommand(id: string): void { $registerCommand(id: string): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册