Skip to content

Commit a9aa12d

Browse files
committed
add commandExecuted event
1 parent ab5846a commit a9aa12d

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/vs/workbench/electron-browser/window.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { toResource } from 'vs/workbench/common/editor';
2525
import { IWorkbenchEditorService, IResourceInputType } from 'vs/workbench/services/editor/common/editorService';
2626
import { IEditorGroupService } from 'vs/workbench/services/group/common/groupService';
2727
import { IMessageService } from 'vs/platform/message/common/message';
28+
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
2829
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
2930
import { IWindowsService, IWindowService, IWindowSettings, IWindowConfiguration, IPath, IOpenFileRequest } from 'vs/platform/windows/common/windows';
3031
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
@@ -84,7 +85,8 @@ export class ElectronWindow extends Themable {
8485
@IViewletService private viewletService: IViewletService,
8586
@IContextMenuService private contextMenuService: IContextMenuService,
8687
@IKeybindingService private keybindingService: IKeybindingService,
87-
@IEnvironmentService private environmentService: IEnvironmentService
88+
@IEnvironmentService private environmentService: IEnvironmentService,
89+
@ITelemetryService private telemetryService: ITelemetryService
8890
) {
8991
super(themeService);
9092

@@ -206,7 +208,11 @@ export class ElectronWindow extends Themable {
206208

207209
// Support runAction event
208210
ipc.on('vscode:runAction', (event, actionId: string) => {
209-
this.commandService.executeCommand(actionId, { from: 'menu' }).done(undefined, err => this.messageService.show(Severity.Error, err));
211+
this.commandService.executeCommand(actionId, { from: 'menu' }).done(_ => {
212+
this.telemetryService.publicLog('commandExecuted', { id: actionId, from: 'menu' });
213+
}, err => {
214+
this.messageService.show(Severity.Error, err);
215+
});
210216
});
211217

212218
// Support resolve keybindings event
@@ -477,4 +483,4 @@ export class ElectronWindow extends Themable {
477483
public focus(): TPromise<void> {
478484
return this.windowService.focusWindow();
479485
}
480-
}
486+
}

0 commit comments

Comments
 (0)