@@ -170,10 +170,11 @@ export class InlineCompletionManager implements Disposable {
170170 const onInlineRejection = async ( ) => {
171171 try {
172172 vsCodeState . isCodeWhispererEditing = true
173- if ( this . sessionManager . getActiveSession ( ) === undefined ) {
173+ const session = this . sessionManager . getActiveSession ( )
174+ if ( session === undefined ) {
174175 return
175176 }
176- const requestStartTime = this . sessionManager . getActiveSession ( ) ! . requestStartTime
177+ const requestStartTime = session . requestStartTime
177178 const totalSessionDisplayTime = performance . now ( ) - requestStartTime
178179 await commands . executeCommand ( 'editor.action.inlineSuggest.hide' )
179180 // TODO: also log the seen state for other suggestions in session
@@ -182,9 +183,9 @@ export class InlineCompletionManager implements Disposable {
182183 CodeWhispererConstants . platformLanguageIds ,
183184 this . inlineCompletionProvider
184185 )
185- const sessionId = this . sessionManager . getActiveSession ( ) ? .sessionId
186+ const sessionId = session . sessionId
186187 const itemId = this . sessionManager . getActiveRecommendation ( ) [ 0 ] ?. itemId
187- if ( ! sessionId || ! itemId ) {
188+ if ( ! itemId ) {
188189 return
189190 }
190191 const params : LogInlineCompletionSessionResultsParams = {
@@ -196,6 +197,7 @@ export class InlineCompletionManager implements Disposable {
196197 discarded : false ,
197198 } ,
198199 } ,
200+ firstCompletionDisplayLatency : session . firstCompletionDisplayLatency ,
199201 totalSessionDisplayTime : totalSessionDisplayTime ,
200202 }
201203 this . languageClient . sendNotification ( this . logSessionResultMessageName , params )
@@ -343,6 +345,7 @@ export class AmazonQInlineCompletionItemProvider implements InlineCompletionItem
343345 discarded : ! prevSession . displayed ,
344346 } ,
345347 } ,
348+ firstCompletionDisplayLatency : prevSession . firstCompletionDisplayLatency ,
346349 totalSessionDisplayTime : performance . now ( ) - prevSession . requestStartTime ,
347350 }
348351 this . languageClient . sendNotification ( this . logSessionResultMessageName , params )
0 commit comments