Skip to content

Commit 7f5f9b7

Browse files
committed
cleanup: remove unused session logic
1 parent b63185c commit 7f5f9b7

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

packages/amazonq/src/app/inline/sessionManager.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ interface CodeWhispererSession {
1717

1818
export class SessionManager {
1919
private activeSession?: CodeWhispererSession
20-
private activeIndex: number = 0
2120
private _acceptedSuggestionCount: number = 0
2221

2322
constructor() {}
@@ -35,7 +34,6 @@ export class SessionManager {
3534
requestStartTime,
3635
firstCompletionDisplayLatency,
3736
}
38-
this.activeIndex = 0
3937
}
4038

4139
public closeSession() {
@@ -56,23 +54,6 @@ export class SessionManager {
5654
this.activeSession.suggestions = [...this.activeSession.suggestions, ...suggestions]
5755
}
5856

59-
public incrementActiveIndex() {
60-
const suggestionCount = this.activeSession?.suggestions?.length
61-
if (!suggestionCount) {
62-
return
63-
}
64-
this.activeIndex === suggestionCount - 1 ? suggestionCount - 1 : this.activeIndex++
65-
}
66-
67-
public decrementActiveIndex() {
68-
this.activeIndex === 0 ? 0 : this.activeIndex--
69-
}
70-
71-
/*
72-
We have to maintain the active suggestion index ourselves because VS Code doesn't expose which suggestion it's currently showing
73-
In order to keep track of the right suggestion state, and for features such as reference tracker, this hack is still needed
74-
*/
75-
7657
public getActiveRecommendation(): InlineCompletionItemWithReferences[] {
7758
if (!this.activeSession) {
7859
return []
@@ -90,6 +71,5 @@ export class SessionManager {
9071

9172
public clear() {
9273
this.activeSession = undefined
93-
this.activeIndex = 0
9474
}
9575
}

packages/amazonq/test/unit/amazonq/apps/inline/recommendationService.test.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,6 @@ describe('RecommendationService', () => {
111111
...expectedRequestArgs,
112112
partialResultToken: mockPartialResultToken,
113113
})
114-
115-
// Verify session management
116-
const items = sessionManager.getActiveRecommendation()
117-
assert.deepStrictEqual(items, [mockInlineCompletionItemOne, { insertText: '1' } as InlineCompletionItem])
118-
sessionManager.incrementActiveIndex()
119-
const items2 = sessionManager.getActiveRecommendation()
120-
assert.deepStrictEqual(items2, [mockInlineCompletionItemTwo, { insertText: '1' } as InlineCompletionItem])
121114
})
122115
})
123116
})

0 commit comments

Comments
 (0)