mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-14 23:21:19 +00:00
Capture telemetry for usage of code actions (#2650)
This commit is contained in:
parent
afbf174e19
commit
31fd6e1470
3 changed files with 13 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ import * as vscode from "vscode"
|
|||
import { ACTION_NAMES, COMMAND_IDS } from "../core/CodeActionProvider"
|
||||
import { EditorUtils } from "../core/EditorUtils"
|
||||
import { ClineProvider } from "../core/webview/ClineProvider"
|
||||
import { telemetryService } from "../services/telemetry/TelemetryService"
|
||||
|
||||
export const registerCodeActions = (context: vscode.ExtensionContext) => {
|
||||
registerCodeActionPair(
|
||||
|
|
|
|||
|
|
@ -269,6 +269,9 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
|
|||
promptType: keyof typeof ACTION_NAMES,
|
||||
params: Record<string, string | any[]>,
|
||||
): Promise<void> {
|
||||
// Capture telemetry for code action usage
|
||||
telemetryService.captureCodeActionUsed(promptType)
|
||||
|
||||
const visibleProvider = await ClineProvider.getInstance()
|
||||
|
||||
if (!visibleProvider) {
|
||||
|
|
@ -302,6 +305,8 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
|
|||
promptType: "TERMINAL_ADD_TO_CONTEXT" | "TERMINAL_FIX" | "TERMINAL_EXPLAIN",
|
||||
params: Record<string, string | any[]>,
|
||||
): Promise<void> {
|
||||
// Capture telemetry for terminal action usage
|
||||
telemetryService.captureCodeActionUsed(promptType)
|
||||
const visibleProvider = await ClineProvider.getInstance()
|
||||
if (!visibleProvider) {
|
||||
return
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ class PostHogClient {
|
|||
CHECKPOINT_CREATED: "Checkpoint Created",
|
||||
CHECKPOINT_RESTORED: "Checkpoint Restored",
|
||||
CHECKPOINT_DIFFED: "Checkpoint Diffed",
|
||||
CODE_ACTION_USED: "Code Action Used",
|
||||
},
|
||||
ERRORS: {
|
||||
SCHEMA_VALIDATION_ERROR: "Schema Validation Error",
|
||||
|
|
@ -268,6 +269,12 @@ class TelemetryService {
|
|||
this.captureEvent(PostHogClient.EVENTS.TASK.CHECKPOINT_RESTORED, { taskId })
|
||||
}
|
||||
|
||||
public captureCodeActionUsed(actionType: string): void {
|
||||
this.captureEvent(PostHogClient.EVENTS.TASK.CODE_ACTION_USED, {
|
||||
actionType,
|
||||
})
|
||||
}
|
||||
|
||||
public captureSchemaValidationError({ schemaName, error }: { schemaName: string; error: ZodError }): void {
|
||||
this.captureEvent(PostHogClient.EVENTS.ERRORS.SCHEMA_VALIDATION_ERROR, {
|
||||
schemaName,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue