Merge pull request #76441 from mjbvz/ICommandsMap-real-map

Use a proper Map for ICommandsMap
This commit is contained in:
Matt Bierner
2019-07-02 17:23:39 -07:00
committed by GitHub
8 changed files with 43 additions and 47 deletions

View File

@@ -36,10 +36,9 @@ export class MainThreadCommands implements MainThreadCommandsShape {
return this._proxy.$getContributedCommandHandlerDescriptions().then(result => {
// add local commands
const commands = CommandsRegistry.getCommands();
for (let id in commands) {
let { description } = commands[id];
if (description) {
result[id] = description;
for (const [id, command] of commands) {
if (command.description) {
result[id] = command.description;
}
}
@@ -79,7 +78,7 @@ export class MainThreadCommands implements MainThreadCommandsShape {
}
$getCommands(): Promise<string[]> {
return Promise.resolve(Object.keys(CommandsRegistry.getCommands()));
return Promise.resolve([...CommandsRegistry.getCommands().keys()]);
}
}