@@ -34,13 +34,13 @@ import { URI } from 'vs/base/common/uri';
3434import { gitCreatePr , gitPushSetUpstream , gitSimilar } from 'vs/workbench/contrib/terminal/browser/terminalQuickFixBuiltinActions' ;
3535const quickFixTelemetryTitle = 'terminal/quick-fix' ;
3636type QuickFixResultTelemetryEvent = {
37- id : string ;
37+ quickFixId : string ;
3838 fixesShown : boolean ;
3939 ranQuickFixCommand ?: boolean ;
4040} ;
4141type QuickFixClassification = {
4242 owner : 'meganrogge' ;
43- id : { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; comment : 'The quick fix ID' } ;
43+ quickFixId : { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; comment : 'The quick fix ID' } ;
4444 fixesShown : { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; comment : 'Whether the fixes were shown by the user' } ;
4545 ranQuickFixCommand ?: { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; comment : 'If the command that was executed matched a quick fix suggested one. Undefined if no command is expected.' } ;
4646 comment : 'Terminal quick fixes' ;
@@ -75,6 +75,7 @@ export class TerminalQuickFixAddon extends Disposable implements ITerminalAddon,
7575
7676 private _fixesShown : boolean = false ;
7777 private _expectedCommands : string [ ] | undefined ;
78+ private _fixId : string | undefined ;
7879
7980 constructor ( private readonly _capabilities : ITerminalCapabilityStore ,
8081 @IContextMenuService private readonly _contextMenuService : IContextMenuService ,
@@ -131,18 +132,20 @@ export class TerminalQuickFixAddon extends Disposable implements ITerminalAddon,
131132 }
132133 this . _register ( commandDetection . onCommandFinished ( command => {
133134 if ( this . _expectedCommands ) {
135+ const quickFixId = this . _fixId || '' ;
134136 const ranQuickFixCommand = this . _expectedCommands . includes ( command . command ) ;
135137 this . _logService . debug ( quickFixTelemetryTitle , {
136- id : this . _expectedCommands . join ( ' ' ) ,
138+ quickFixId ,
137139 fixesShown : this . _fixesShown ,
138140 ranQuickFixCommand
139141 } ) ;
140142 this . _telemetryService ?. publicLog2 < QuickFixResultTelemetryEvent , QuickFixClassification > ( quickFixTelemetryTitle , {
141- id : this . _expectedCommands . join ( ' ' ) ,
143+ quickFixId ,
142144 fixesShown : this . _fixesShown ,
143145 ranQuickFixCommand
144146 } ) ;
145147 this . _expectedCommands = undefined ;
148+ this . _fixId = undefined ;
146149 }
147150 this . _resolveQuickFixes ( command ) ;
148151 this . _fixesShown = false ;
@@ -170,16 +173,17 @@ export class TerminalQuickFixAddon extends Disposable implements ITerminalAddon,
170173 }
171174 const { fixes, onDidRunQuickFix, expectedCommands } = result ;
172175 this . _expectedCommands = expectedCommands ;
176+ this . _fixId = fixes . map ( f => f . id ) . join ( '' ) ;
173177 this . _quickFixes = fixes ;
174- this . _register ( onDidRunQuickFix ( ( id ) => {
178+ this . _register ( onDidRunQuickFix ( ( quickFixId ) => {
175179 const ranQuickFixCommand = ( this . _expectedCommands ?. includes ( command . command ) || false ) ;
176180 this . _logService . debug ( quickFixTelemetryTitle , {
177- id ,
181+ quickFixId ,
178182 fixesShown : this . _fixesShown ,
179183 ranQuickFixCommand
180184 } ) ;
181185 this . _telemetryService ?. publicLog2 < QuickFixResultTelemetryEvent , QuickFixClassification > ( quickFixTelemetryTitle , {
182- id ,
186+ quickFixId ,
183187 fixesShown : this . _fixesShown ,
184188 ranQuickFixCommand
185189 } ) ;
@@ -270,7 +274,7 @@ export function getQuickFixesForCommand(
270274 case 'command' : {
271275 const label = localize ( 'quickFix.command' , 'Run: {0}' , quickFix . command ) ;
272276 action = {
273- id : ` quickFix.command` ,
277+ id : quickFix . id ,
274278 label,
275279 class : undefined ,
276280 enabled : true ,
@@ -372,6 +376,7 @@ export function convertToQuickFixOptions(quickFix: IExtensionTerminalQuickFix):
372376 if ( fixedCommand ) {
373377 actions . push ( {
374378 type : 'command' ,
379+ id : quickFix . id ,
375380 command : fixedCommand ,
376381 addNewLine : true
377382 } ) ;
0 commit comments