@@ -34,13 +34,13 @@ import { URI } from 'vs/base/common/uri';
34
34
import { gitCreatePr , gitPushSetUpstream , gitSimilar } from 'vs/workbench/contrib/terminal/browser/terminalQuickFixBuiltinActions' ;
35
35
const quickFixTelemetryTitle = 'terminal/quick-fix' ;
36
36
type QuickFixResultTelemetryEvent = {
37
- id : string ;
37
+ quickFixId : string ;
38
38
fixesShown : boolean ;
39
39
ranQuickFixCommand ?: boolean ;
40
40
} ;
41
41
type QuickFixClassification = {
42
42
owner : 'meganrogge' ;
43
- id : { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; comment : 'The quick fix ID' } ;
43
+ quickFixId : { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; comment : 'The quick fix ID' } ;
44
44
fixesShown : { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; comment : 'Whether the fixes were shown by the user' } ;
45
45
ranQuickFixCommand ?: { classification : 'SystemMetaData' ; purpose : 'FeatureInsight' ; comment : 'If the command that was executed matched a quick fix suggested one. Undefined if no command is expected.' } ;
46
46
comment : 'Terminal quick fixes' ;
@@ -75,6 +75,7 @@ export class TerminalQuickFixAddon extends Disposable implements ITerminalAddon,
75
75
76
76
private _fixesShown : boolean = false ;
77
77
private _expectedCommands : string [ ] | undefined ;
78
+ private _fixId : string | undefined ;
78
79
79
80
constructor ( private readonly _capabilities : ITerminalCapabilityStore ,
80
81
@IContextMenuService private readonly _contextMenuService : IContextMenuService ,
@@ -131,18 +132,20 @@ export class TerminalQuickFixAddon extends Disposable implements ITerminalAddon,
131
132
}
132
133
this . _register ( commandDetection . onCommandFinished ( command => {
133
134
if ( this . _expectedCommands ) {
135
+ const quickFixId = this . _fixId || '' ;
134
136
const ranQuickFixCommand = this . _expectedCommands . includes ( command . command ) ;
135
137
this . _logService . debug ( quickFixTelemetryTitle , {
136
- id : this . _expectedCommands . join ( ' ' ) ,
138
+ quickFixId ,
137
139
fixesShown : this . _fixesShown ,
138
140
ranQuickFixCommand
139
141
} ) ;
140
142
this . _telemetryService ?. publicLog2 < QuickFixResultTelemetryEvent , QuickFixClassification > ( quickFixTelemetryTitle , {
141
- id : this . _expectedCommands . join ( ' ' ) ,
143
+ quickFixId ,
142
144
fixesShown : this . _fixesShown ,
143
145
ranQuickFixCommand
144
146
} ) ;
145
147
this . _expectedCommands = undefined ;
148
+ this . _fixId = undefined ;
146
149
}
147
150
this . _resolveQuickFixes ( command ) ;
148
151
this . _fixesShown = false ;
@@ -170,16 +173,17 @@ export class TerminalQuickFixAddon extends Disposable implements ITerminalAddon,
170
173
}
171
174
const { fixes, onDidRunQuickFix, expectedCommands } = result ;
172
175
this . _expectedCommands = expectedCommands ;
176
+ this . _fixId = fixes . map ( f => f . id ) . join ( '' ) ;
173
177
this . _quickFixes = fixes ;
174
- this . _register ( onDidRunQuickFix ( ( id ) => {
178
+ this . _register ( onDidRunQuickFix ( ( quickFixId ) => {
175
179
const ranQuickFixCommand = ( this . _expectedCommands ?. includes ( command . command ) || false ) ;
176
180
this . _logService . debug ( quickFixTelemetryTitle , {
177
- id ,
181
+ quickFixId ,
178
182
fixesShown : this . _fixesShown ,
179
183
ranQuickFixCommand
180
184
} ) ;
181
185
this . _telemetryService ?. publicLog2 < QuickFixResultTelemetryEvent , QuickFixClassification > ( quickFixTelemetryTitle , {
182
- id ,
186
+ quickFixId ,
183
187
fixesShown : this . _fixesShown ,
184
188
ranQuickFixCommand
185
189
} ) ;
@@ -270,7 +274,7 @@ export function getQuickFixesForCommand(
270
274
case 'command' : {
271
275
const label = localize ( 'quickFix.command' , 'Run: {0}' , quickFix . command ) ;
272
276
action = {
273
- id : ` quickFix.command` ,
277
+ id : quickFix . id ,
274
278
label,
275
279
class : undefined ,
276
280
enabled : true ,
@@ -372,6 +376,7 @@ export function convertToQuickFixOptions(quickFix: IExtensionTerminalQuickFix):
372
376
if ( fixedCommand ) {
373
377
actions . push ( {
374
378
type : 'command' ,
379
+ id : quickFix . id ,
375
380
command : fixedCommand ,
376
381
addNewLine : true
377
382
} ) ;
0 commit comments