Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion packages/amazonq/src/app/inline/completion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ import {
inlineCompletionsDebounceDelay,
noInlineSuggestionsMsg,
ReferenceInlineProvider,
getDiagnosticsDifferences,
getDiagnosticsOfCurrentFile,
toIdeDiagnostics,
} from 'aws-core-vscode/codewhisperer'
import { LineTracker } from './stateTracker/lineTracker'
import { InlineTutorialAnnotation } from './tutorials/inlineTutorialAnnotation'
Expand Down Expand Up @@ -116,6 +119,13 @@ export class InlineCompletionManager implements Disposable {
firstCompletionDisplayLatency?: number
) => {
// TODO: also log the seen state for other suggestions in session
// Calculate timing metrics before diagnostic delay
const totalSessionDisplayTime = performance.now() - requestStartTime
await sleep(1000)
const diagnosticDiff = getDiagnosticsDifferences(
this.sessionManager.getActiveSession()?.diagnosticsBeforeAccept,
getDiagnosticsOfCurrentFile()
)
const params: LogInlineCompletionSessionResultsParams = {
sessionId: sessionId,
completionSessionResult: {
Expand All @@ -125,8 +135,10 @@ export class InlineCompletionManager implements Disposable {
discarded: false,
},
},
totalSessionDisplayTime: Date.now() - requestStartTime,
totalSessionDisplayTime: totalSessionDisplayTime,
firstCompletionDisplayLatency: firstCompletionDisplayLatency,
addedDiagnostics: diagnosticDiff.added.map((it) => toIdeDiagnostics(it)),
removedDiagnostics: diagnosticDiff.removed.map((it) => toIdeDiagnostics(it)),
}
this.languageClient.sendNotification(this.logSessionResultMessageName, params)
this.disposable.dispose()
Expand Down
4 changes: 4 additions & 0 deletions packages/amazonq/src/app/inline/sessionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/
import * as vscode from 'vscode'
import { InlineCompletionItemWithReferences } from '@aws/language-server-runtimes-types'
import { FileDiagnostic, getDiagnosticsOfCurrentFile } from 'aws-core-vscode/codewhisperer'

// TODO: add more needed data to the session interface
export interface CodeWhispererSession {
Expand All @@ -14,6 +15,7 @@ export interface CodeWhispererSession {
requestStartTime: number
firstCompletionDisplayLatency?: number
startPosition: vscode.Position
diagnosticsBeforeAccept: FileDiagnostic | undefined
// partialResultToken for the next trigger if user accepts an EDITS suggestion
editsStreakPartialResultToken?: number | string
}
Expand All @@ -31,13 +33,15 @@ export class SessionManager {
startPosition: vscode.Position,
firstCompletionDisplayLatency?: number
) {
const diagnosticsBeforeAccept = getDiagnosticsOfCurrentFile()
this.activeSession = {
sessionId,
suggestions,
isRequestInProgress: true,
requestStartTime,
startPosition,
firstCompletionDisplayLatency,
diagnosticsBeforeAccept,
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -471,8 +471,8 @@
"@aws-sdk/types": "^3.13.1",
"@aws/chat-client": "^0.1.4",
"@aws/chat-client-ui-types": "^0.1.47",
"@aws/language-server-runtimes": "^0.2.99",
"@aws/language-server-runtimes-types": "^0.1.41",
"@aws/language-server-runtimes": "^0.2.101",
"@aws/language-server-runtimes-types": "^0.1.42",
"@cspotcode/source-map-support": "^0.8.1",
"@sinonjs/fake-timers": "^10.0.2",
"@types/adm-zip": "^0.4.34",
Expand Down
Loading