File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import * as vscode from "vscode"
33import { ACTION_NAMES , COMMAND_IDS } from "../core/CodeActionProvider"
44import { EditorUtils } from "../core/EditorUtils"
55import { ClineProvider } from "../core/webview/ClineProvider"
6+ import { telemetryService } from "../services/telemetry/TelemetryService"
67
78export const registerCodeActions = ( context : vscode . ExtensionContext ) => {
89 registerCodeActionPair (
Original file line number Diff line number Diff line change @@ -269,6 +269,9 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
269269 promptType : keyof typeof ACTION_NAMES ,
270270 params : Record < string , string | any [ ] > ,
271271 ) : Promise < void > {
272+ // Capture telemetry for code action usage
273+ telemetryService . captureCodeActionUsed ( promptType )
274+
272275 const visibleProvider = await ClineProvider . getInstance ( )
273276
274277 if ( ! visibleProvider ) {
@@ -302,6 +305,8 @@ export class ClineProvider extends EventEmitter<ClineProviderEvents> implements
302305 promptType : "TERMINAL_ADD_TO_CONTEXT" | "TERMINAL_FIX" | "TERMINAL_EXPLAIN" ,
303306 params : Record < string , string | any [ ] > ,
304307 ) : Promise < void > {
308+ // Capture telemetry for terminal action usage
309+ telemetryService . captureCodeActionUsed ( promptType )
305310 const visibleProvider = await ClineProvider . getInstance ( )
306311 if ( ! visibleProvider ) {
307312 return
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ class PostHogClient {
2727 CHECKPOINT_CREATED : "Checkpoint Created" ,
2828 CHECKPOINT_RESTORED : "Checkpoint Restored" ,
2929 CHECKPOINT_DIFFED : "Checkpoint Diffed" ,
30+ CODE_ACTION_USED : "Code Action Used" ,
3031 } ,
3132 ERRORS : {
3233 SCHEMA_VALIDATION_ERROR : "Schema Validation Error" ,
@@ -268,6 +269,12 @@ class TelemetryService {
268269 this . captureEvent ( PostHogClient . EVENTS . TASK . CHECKPOINT_RESTORED , { taskId } )
269270 }
270271
272+ public captureCodeActionUsed ( actionType : string ) : void {
273+ this . captureEvent ( PostHogClient . EVENTS . TASK . CODE_ACTION_USED , {
274+ actionType,
275+ } )
276+ }
277+
271278 public captureSchemaValidationError ( { schemaName, error } : { schemaName : string ; error : ZodError } ) : void {
272279 this . captureEvent ( PostHogClient . EVENTS . ERRORS . SCHEMA_VALIDATION_ERROR , {
273280 schemaName,
You can’t perform that action at this time.
0 commit comments