diff --git a/src/vs/workbench/api/browser/mainThreadCommands.ts b/src/vs/workbench/api/browser/mainThreadCommands.ts index ff817619ff775f3c477398dc3f983aa59811dc79..38f6ac6692706f84921f6c79dd4d0a5e3f3ad960 100644 --- a/src/vs/workbench/api/browser/mainThreadCommands.ts +++ b/src/vs/workbench/api/browser/mainThreadCommands.ts @@ -34,23 +34,23 @@ export class MainThreadCommands implements MainThreadCommandsShape { this._generateCommandsDocumentationRegistration.dispose(); } - private _generateCommandsDocumentation(): Promise { - return this._proxy.$getContributedCommandHandlerDescriptions().then(result => { - // add local commands - const commands = CommandsRegistry.getCommands(); - for (const [id, command] of commands) { - if (command.description) { - result[id] = command.description; - } - } + private async _generateCommandsDocumentation(): Promise { + const result = await this._proxy.$getContributedCommandHandlerDescriptions(); - // print all as markdown - const all: string[] = []; - for (let id in result) { - all.push('`' + id + '` - ' + _generateMarkdown(result[id])); + // add local commands + const commands = CommandsRegistry.getCommands(); + for (const [id, command] of commands) { + 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 {