Skip to content

Commit 62add30

Browse files
committed
test
1 parent cd2b4d7 commit 62add30

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/amazonq/test/unit/codewhisperer/testUtil.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,11 @@ export async function acceptByTab() {
3737
// we have to wait until the inline suggestion is shown in the editor however we don't have an useable API for that so hacky wait to know if the accept is taking effect
3838
await waitUntil(
3939
async () => {
40-
await sleep(50)
4140
await vscode.commands.executeCommand('editor.action.inlineSuggest.commit')
42-
console.log(editor.document.getText())
43-
if (editor.document.getText() !== originalContent) {
44-
return true
45-
}
41+
return vscode.window.activeTextEditor?.document.getText() !== originalContent
4642
},
4743
{
48-
interval: 500,
44+
interval: 50,
4945
timeout: 5000,
5046
}
5147
)

packages/core/src/codewhisperer/service/recommendationHandler.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ const rejectCommand = Commands.declare('aws.amazonq.rejectCodeSuggestion', () =>
7070
traceId: TelemetryHelper.instance.traceId,
7171
})
7272

73+
// eslint-disable-next-line aws-toolkits/no-console-log
74+
console.log('hiding inlineSuggest')
7375
await vscode.commands.executeCommand('editor.action.inlineSuggest.hide')
7476
RecommendationHandler.instance.reportUserDecisions(-1)
7577
await Commands.tryExecute('aws.amazonq.refreshAnnotation')
@@ -504,6 +506,8 @@ export class RecommendationHandler {
504506
// fix a regression that requires user to hit Esc twice to clear inline ghost text
505507
// because disposing a provider does not clear the UX
506508
if (isVscHavingRegressionInlineCompletionApi()) {
509+
// eslint-disable-next-line aws-toolkits/no-console-log
510+
console.log('hiding inlineSuggest')
507511
await vscode.commands.executeCommand('editor.action.inlineSuggest.hide')
508512
}
509513
} finally {
@@ -694,7 +698,7 @@ export class RecommendationHandler {
694698
// a new provider does not auto refresh the inline suggestion widget
695699
// by manually refresh it
696700
// eslint-disable-next-line aws-toolkits/no-console-log
697-
console.log('using the regressioned api')
701+
console.log('hiding inlineSuggest')
698702
await vscode.commands.executeCommand('editor.action.inlineSuggest.hide')
699703
await vscode.commands.executeCommand('editor.action.inlineSuggest.trigger')
700704
}

0 commit comments

Comments
 (0)