diff --git a/src/vs/platform/commands/common/commandService.ts b/src/vs/platform/commands/common/commandService.ts index ac972ac99aa22..db0aff02f20c9 100644 --- a/src/vs/platform/commands/common/commandService.ts +++ b/src/vs/platform/commands/common/commandService.ts @@ -38,11 +38,16 @@ export class CommandService extends Disposable implements ICommandService { // host didn't yet start and the command is already registered const activation = this._extensionService.activateByEvent(`onCommand:${id}`); + const commandIsRegistered = !!CommandsRegistry.getCommand(id); - if (!this._extensionHostIsReady && CommandsRegistry.getCommand(id)) { + if (!this._extensionHostIsReady && commandIsRegistered) { return this._tryExecuteCommand(id, args); } else { - return activation.then(_ => this._tryExecuteCommand(id, args)); + let waitFor: TPromise = activation; + if (!commandIsRegistered) { + waitFor = TPromise.join([activation, this._extensionService.activateByEvent(`*`)]); + } + return waitFor.then(_ => this._tryExecuteCommand(id, args)); } }