Skip to content

Commit 5a9ca1b

Browse files
committed
test
1 parent 5ac35b9 commit 5a9ca1b

File tree

2 files changed

+36
-25
lines changed

2 files changed

+36
-25
lines changed

packages/amazonq/test/e2e/inline/inline.test.ts

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as vscode from 'vscode'
77
import assert from 'assert'
88
import {
99
closeAllEditors,
10-
getTestWindow,
10+
// getTestWindow,
1111
registerAuthHook,
1212
resetCodeWhispererGlobalVariables,
1313
TestFolder,
@@ -92,14 +92,15 @@ describe('Amazon Q Inline', async function () {
9292
}
9393

9494
for (const [name, invokeCompletion] of [
95-
['automatic', async () => await vscode.commands.executeCommand('type', { text: '\n' })],
95+
// ['automatic', async () => await vscode.commands.executeCommand('type', { text: '\n' })],
9696
['manual', async () => await Commands.tryExecute('aws.amazonq.invokeInlineCompletion')],
9797
] as const) {
9898
describe(`${name} invoke`, async function () {
9999
let originalEditorContents: string | undefined
100100

101101
describe('supported filetypes', () => {
102102
beforeEach(async () => {
103+
console.log('manually setting up editor')
103104
await setupEditor()
104105

105106
/**
@@ -110,11 +111,14 @@ describe('Amazon Q Inline', async function () {
110111
*
111112
* note: this number is entirely arbitrary
112113
**/
114+
console.log('sleeping')
113115
await sleep(1000)
114116

117+
console.log('invoking')
115118
await invokeCompletion()
116119
originalEditorContents = vscode.window.activeTextEditor?.document.getText()
117120

121+
console.log('waiting for recommendations')
118122
// wait until the ghost text appears
119123
await waitForRecommendations()
120124
})
@@ -161,28 +165,28 @@ describe('Amazon Q Inline', async function () {
161165
})
162166
})
163167

164-
it(`${name} invoke on unsupported filetype`, async function () {
165-
await setupEditor({
166-
name: 'test.zig',
167-
contents: `fn doSomething() void {
168-
169-
}`,
170-
})
171-
172-
/**
173-
* Add delay between editor loading and invoking completion
174-
* @see beforeEach in supported filetypes for more information
175-
*/
176-
await sleep(1000)
177-
await invokeCompletion()
178-
179-
// if (name === 'automatic') {
180-
// It should never get triggered since its not a supported file type
181-
// assert.deepStrictEqual(RecommendationService.instance.isRunning, false)
182-
// } else {
183-
await getTestWindow().waitForMessage('currently not supported by Amazon Q inline suggestions')
184-
// }
185-
})
168+
// it(`${name} invoke on unsupported filetype`, async function () {
169+
// await setupEditor({
170+
// name: 'test.zig',
171+
// contents: `fn doSomething() void {
172+
173+
// }`,
174+
// })
175+
176+
// /**
177+
// * Add delay between editor loading and invoking completion
178+
// * @see beforeEach in supported filetypes for more information
179+
// */
180+
// await sleep(1000)
181+
// await invokeCompletion()
182+
183+
// // if (name === 'automatic') {
184+
// // It should never get triggered since its not a supported file type
185+
// // assert.deepStrictEqual(RecommendationService.instance.isRunning, false)
186+
// // } else {
187+
// await getTestWindow().waitForMessage('currently not supported by Amazon Q inline suggestions')
188+
// // }
189+
// })
186190
})
187191
}
188192
})

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,8 @@ export class RecommendationHandler {
607607
}
608608

609609
public disposeInlineCompletion() {
610+
// eslint-disable-next-line aws-toolkits/no-console-log
611+
console.log('disposing of inline provider')
610612
this.inlineCompletionProviderDisposable?.dispose()
611613
this.inlineCompletionProvider = undefined
612614
}
@@ -659,6 +661,8 @@ export class RecommendationHandler {
659661
this.reportDiscardedUserDecisions()
660662
return
661663
}
664+
// eslint-disable-next-line aws-toolkits/no-console-log
665+
console.log('setting inline provider')
662666
const inlineCompletionProvider = new CWInlineCompletionItemProvider(
663667
this.inlineCompletionProvider?.getActiveItemIndex,
664668
indexShift,
@@ -674,7 +678,8 @@ export class RecommendationHandler {
674678
inlineCompletionProvider
675679
)
676680
this.inlineCompletionProvider = inlineCompletionProvider
677-
681+
// eslint-disable-next-line aws-toolkits/no-console-log
682+
console.log('is suggestion visible: %O', noSuggestionVisible)
678683
if (isVscHavingRegressionInlineCompletionApi() && !noSuggestionVisible) {
679684
// fix a regression in new VS Code when disposing and re-registering
680685
// a new provider does not auto refresh the inline suggestion widget
@@ -778,6 +783,8 @@ export class RecommendationHandler {
778783
editor.selection.active.isBefore(session.startPos) ||
779784
editor.document.uri.fsPath !== this.documentUri?.fsPath
780785
) {
786+
// eslint-disable-next-line aws-toolkits/no-console-log
787+
console.log('discarding the entries')
781788
for (const [i, _] of session.recommendations.entries()) {
782789
session.setSuggestionState(i, 'Discard')
783790
}

0 commit comments

Comments
 (0)