@@ -310,6 +310,7 @@ export async function activate(context: vscode.ExtensionContext) {
310310 languageId ,
311311 Array . isArray ( diagnostics ) ? diagnostics : undefined ,
312312 )
313+ telemetryService . captureButtonClick ( "codeAction_addToChat" , visibleWebview ?. controller . task ?. taskId , true )
313314 } ) ,
314315 )
315316
@@ -481,6 +482,7 @@ export async function activate(context: vscode.ExtensionContext) {
481482 // Send to sidebar provider with diagnostics
482483 const visibleWebview = WebviewProvider . getVisibleInstance ( )
483484 await visibleWebview ?. controller . fixWithCline ( selectedText , filePath , languageId , diagnostics )
485+ telemetryService . captureButtonClick ( "codeAction_fixWithCline" , visibleWebview ?. controller . task ?. taskId , true )
484486 } ) ,
485487 )
486488
@@ -502,6 +504,7 @@ export async function activate(context: vscode.ExtensionContext) {
502504 const fileMention = visibleWebview ?. controller . getFileMentionFromPath ( filePath ) || filePath
503505 const prompt = `Explain the following code from ${ fileMention } :\n\`\`\`${ editor . document . languageId } \n${ selectedText } \n\`\`\``
504506 await visibleWebview ?. controller . initTask ( prompt )
507+ telemetryService . captureButtonClick ( "codeAction_explainCode" , visibleWebview ?. controller . task ?. taskId , true )
505508 } ) ,
506509 )
507510
@@ -523,6 +526,7 @@ export async function activate(context: vscode.ExtensionContext) {
523526 const fileMention = visibleWebview ?. controller . getFileMentionFromPath ( filePath ) || filePath
524527 const prompt = `Improve the following code from ${ fileMention } (e.g., suggest refactorings, optimizations, or better practices):\n\`\`\`${ editor . document . languageId } \n${ selectedText } \n\`\`\``
525528 await visibleWebview ?. controller . initTask ( prompt )
529+ telemetryService . captureButtonClick ( "codeAction_improveCode" , visibleWebview ?. controller . task ?. taskId , true )
526530 } ) ,
527531 )
528532
@@ -584,6 +588,7 @@ export async function activate(context: vscode.ExtensionContext) {
584588 "Could not activate Cline view. Please try opening it manually from the Activity Bar." ,
585589 )
586590 }
591+ telemetryService . captureButtonClick ( "command_focusChatInput" , activeWebviewProvider ?. controller . task ?. taskId , true )
587592 } ) ,
588593 )
589594
0 commit comments