提交 fe1666c9 编写于 作者: J Johannes Rieken

commands - activate first, check for command second

上级 3f9f7514
......@@ -22,12 +22,13 @@ export class CommandService implements ICommandService {
executeCommand<T>(id: string, ...args: any[]): TPromise<T> {
const command = CommandsRegistry.getCommand(id);
if (!command) {
return TPromise.wrapError(new Error(`command '${id}' not found`));
}
return this._extensionService.activateByEvent(`onCommand:${id}`).then(_ => {
const command = CommandsRegistry.getCommand(id);
if (!command) {
return TPromise.wrapError(new Error(`command '${id}' not found`));
}
try {
const result = this._instantiationService.invokeFunction.apply(this._instantiationService, [command.handler].concat(args));
return TPromise.as(result);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册