Skip to content

Commit c96106d

Browse files
authored
fix: inline, nep telemetry not sent and throw sessionId not found (#2419)
1 parent 178deec commit c96106d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

server/aws-lsp-codewhisperer/src/language-server/inline-completion/handler/sessionResultsHandler.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,15 @@ export class SessionResultsHandler {
6464
removedDiagnostics,
6565
} = params
6666

67-
const sessionManager = params.isInlineEdit ? this.editSessionManager : this.completionSessionManager
67+
// Comment this out because Edit request might return Completion as well so we can't rely on this flag
68+
// const sessionManager = params.isInlineEdit ? this.editSessionManager : this.completionSessionManager
6869

69-
const session = sessionManager.getSessionById(sessionId)
70+
// TODO: Not elegant, worth refactoring
71+
const editSession = this.editSessionManager.getSessionById(sessionId)
72+
const completionSession = this.completionSessionManager.getSessionById(sessionId)
73+
74+
const session = editSession ?? completionSession
75+
const sessionManager = editSession ? this.editSessionManager : this.completionSessionManager
7076
if (!session) {
7177
this.logging.log(`ERROR: Session ID ${sessionId} was not found`)
7278
return

0 commit comments

Comments
 (0)