Skip to content

Commit

Permalink
add telemetry for running command from remote menu (#173778)
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli authored Feb 8, 2023
1 parent 0abffa4 commit 85e0340
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/vs/workbench/contrib/remote/browser/remoteIndicator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ import { IMarkdownString, MarkdownString } from 'vs/base/common/htmlContent';
import { RemoteNameContext, VirtualWorkspaceContext } from 'vs/workbench/common/contextkeys';
import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite';
import { ViewContainerLocation } from 'vs/workbench/common/views';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { WorkbenchActionExecutedClassification, WorkbenchActionExecutedEvent } from 'vs/base/common/actions';

type ActionGroup = [string, Array<MenuItemAction | SubmenuItemAction>];
export class RemoteStatusIndicator extends Disposable implements IWorkbenchContribution {
Expand Down Expand Up @@ -78,7 +80,8 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
@IHostService private readonly hostService: IHostService,
@IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
@ILogService private readonly logService: ILogService,
@IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService
@IExtensionGalleryService private readonly extensionGalleryService: IExtensionGalleryService,
@ITelemetryService private readonly telemetryService: ITelemetryService,
) {
super();

Expand Down Expand Up @@ -479,7 +482,12 @@ export class RemoteStatusIndicator extends Disposable implements IWorkbenchContr
once(quickPick.onDidAccept)((_ => {
const selectedItems = quickPick.selectedItems;
if (selectedItems.length === 1) {
this.commandService.executeCommand(selectedItems[0].id!);
const commandId = selectedItems[0].id!;
this.telemetryService.publicLog2<WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification>('workbenchActionExecuted', {
id: commandId,
from: 'remote indicator'
});
this.commandService.executeCommand(commandId);
}

quickPick.hide();
Expand Down

0 comments on commit 85e0340

Please sign in to comment.