src/vs/workbench/services/commands/common/commandService.ts/CommandService/executeCommand
class CommandService:	executeCommand<T>(id: string, ...args: any[]): Promise<T> {
		this._logService.trace('CommandService#executeCommand', id);

		// we always send an activation event, but
		// we don't wait for it when the extension
		// host didn't yet start and the command is already registered

		const activation: Promise<any> = this._extensionService.activateByEvent(`onCommand:${id}`);
		const commandIsRegistered = !!CommandsRegistry.getCommand(id);

		if (!this._extensionHostIsReady && commandIsRegistered) {
			return this._tryExecuteCommand(id, args);
		} else {
			let waitFor = activation;
			if (!commandIsRegistered) {
				waitFor = Promise.all([
					activation,
					Promise.race<any>([
						// race * activation against command registration
						this._activateStar(),
						Event.toPromise(Event.filter(CommandsRegistry.onDidRegisterCommand, e => e === id))
					]),
				]);
			}
			return waitFor.then(_ => this._tryExecuteCommand(id, args));
		}
	}