@@ -170,10 +170,11 @@ export class InlineCompletionManager implements Disposable {
170
170
const onInlineRejection = async ( ) => {
171
171
try {
172
172
vsCodeState . isCodeWhispererEditing = true
173
- if ( this . sessionManager . getActiveSession ( ) === undefined ) {
173
+ const session = this . sessionManager . getActiveSession ( )
174
+ if ( session === undefined ) {
174
175
return
175
176
}
176
- const requestStartTime = this . sessionManager . getActiveSession ( ) ! . requestStartTime
177
+ const requestStartTime = session . requestStartTime
177
178
const totalSessionDisplayTime = performance . now ( ) - requestStartTime
178
179
await commands . executeCommand ( 'editor.action.inlineSuggest.hide' )
179
180
// TODO: also log the seen state for other suggestions in session
@@ -182,9 +183,9 @@ export class InlineCompletionManager implements Disposable {
182
183
CodeWhispererConstants . platformLanguageIds ,
183
184
this . inlineCompletionProvider
184
185
)
185
- const sessionId = this . sessionManager . getActiveSession ( ) ? .sessionId
186
+ const sessionId = session . sessionId
186
187
const itemId = this . sessionManager . getActiveRecommendation ( ) [ 0 ] ?. itemId
187
- if ( ! sessionId || ! itemId ) {
188
+ if ( ! itemId ) {
188
189
return
189
190
}
190
191
const params : LogInlineCompletionSessionResultsParams = {
@@ -196,6 +197,7 @@ export class InlineCompletionManager implements Disposable {
196
197
discarded : false ,
197
198
} ,
198
199
} ,
200
+ firstCompletionDisplayLatency : session . firstCompletionDisplayLatency ,
199
201
totalSessionDisplayTime : totalSessionDisplayTime ,
200
202
}
201
203
this . languageClient . sendNotification ( this . logSessionResultMessageName , params )
@@ -343,6 +345,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
343
345
discarded : ! prevSession . displayed ,
344
346
} ,
345
347
} ,
348
+ firstCompletionDisplayLatency : prevSession . firstCompletionDisplayLatency ,
346
349
totalSessionDisplayTime : performance . now ( ) - prevSession . requestStartTime ,
347
350
}
348
351
this . languageClient . sendNotification ( this . logSessionResultMessageName , params )
0 commit comments