Merge from vscode 5b9869eb02fa4c96205a74d05cad9164dfd06d60 (#5607)

This commit is contained in:
Anthony Dresser
2019-05-24 12:20:30 -07:00
committed by GitHub
parent 361ada4963
commit bcc449b524
126 changed files with 3096 additions and 2255 deletions

View File

@@ -172,7 +172,7 @@ class NativeContextMenuService extends Disposable implements IContextMenuService
}
}
private runAction(actionRunner: IActionRunner, actionToRun: IAction, delegate: IContextMenuDelegate, event: IContextMenuEvent): void {
private async runAction(actionRunner: IActionRunner, actionToRun: IAction, delegate: IContextMenuDelegate, event: IContextMenuEvent): Promise<void> {
/* __GDPR__
"workbenchActionExecuted" : {
"id" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" },
@@ -182,9 +182,15 @@ class NativeContextMenuService extends Disposable implements IContextMenuService
this.telemetryService.publicLog('workbenchActionExecuted', { id: actionToRun.id, from: 'contextMenu' });
const context = delegate.getActionsContext ? delegate.getActionsContext(event) : event;
const res = actionRunner.run(actionToRun, context) || Promise.resolve(null);
res.then(undefined, e => this.notificationService.error(e));
const runnable = actionRunner.run(actionToRun, context);
if (runnable) {
try {
await runnable;
} catch (error) {
this.notificationService.error(error);
}
}
}
}