Skip to content

Commit

Permalink
Fixes microsoft#34913: Wait for * activation when the command is no…
Browse files Browse the repository at this point in the history
…t registered
  • Loading branch information
alexdima committed Feb 7, 2018
1 parent 370e10e commit 4c43954
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/vs/platform/commands/common/commandService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<any> = activation;
if (!commandIsRegistered) {
waitFor = TPromise.join([activation, this._extensionService.activateByEvent(`*`)]);
}
return waitFor.then(_ => this._tryExecuteCommand(id, args));
}
}

Expand Down

0 comments on commit 4c43954

Please sign in to comment.