Skip to content

Commit 03da93a

Browse files
authored
fix(codelens): set AmazonQ chat to open by default aws#5088
Problem - Default Case: New user installs Amazon Q and Chat is open with Tips. - When a user closes the tip, the codelens is visible. This is because the `isAmazonQChatVisible` event is not triggered until explicit action by the user Solution - Set default value for `isAmazonQVisible` to `true`. - Now codelens will be only be visible when the user manually opens the chat window.
1 parent cd9be21 commit 03da93a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/core/src/codewhispererChat/editor/codelens.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export class TryChatCodeLensProvider implements vscode.CodeLensProvider {
3838
private static providerDisposable: vscode.Disposable | undefined = undefined
3939
private disposables: vscode.Disposable[] = []
4040

41-
private isAmazonQVisible: boolean = false
41+
// Assumption: Amazon Q is visible by default and codelens should be hidden
42+
private isAmazonQVisible: boolean = true
4243

4344
constructor(
4445
isAmazonQVisibleEvent: vscode.Event<boolean>,

packages/core/src/test/codewhispererChat/editor/codelens.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ describe('TryChatCodeLensProvider', () => {
6363

6464
it('keeps returning a code lense until it hits the max times it should show', async function () {
6565
stubConnection('connected')
66-
66+
isAmazonQVisibleEventEmitter.fire(false)
6767
let codeLensCount = 0
6868
const modifierKey = resolveModifierKey()
6969
while (codeLensCount < 10) {
@@ -123,6 +123,7 @@ describe('TryChatCodeLensProvider', () => {
123123

124124
it('does show codelens if lineAnnotationController (tips) is in end state', async function () {
125125
stubConnection('connected')
126+
isAmazonQVisibleEventEmitter.fire(false)
126127
// indicate lineAnnotationController is not visible and in end state
127128
await globals.context.globalState.update(inlinehintKey, EndState.id)
128129

0 commit comments

Comments
 (0)