Skip to content

Commit 6047137

Browse files
committed
fix: small PR comments
1 parent 12b7763 commit 6047137

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

packages/amazonq/test/e2e_new/amazonq/tests/inline.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe('Amazon Q Inline Completion / Chat Functionality', function () {
2525
textEditor = await createNewTextFile(workbench, editorView)
2626
})
2727
afterEach(async function () {
28-
// Switch back to Webview Iframe when dealing with external webviews from Amazon Q.
28+
// Switch back to iframe when dealing with external webviews from Amazon Q.
2929
await editorView.closeAllEditors()
3030
await webviewView.switchToFrame()
3131
})

packages/amazonq/test/e2e_new/amazonq/utils/generalUtils.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,14 @@ export async function writeToTextEditor(textEditor: TextEditor, text: string): P
165165
}
166166

167167
/**
168-
* Waits for Inline Generation by Amazon Q by checking if line count stops changing
168+
* Waits for Inline Generation by Amazon Q by checking if line count stops changing.
169+
* The function checks for a "stable state" by monitoring the number of lines in the editor.
170+
* A stable state is achieved when the line count remains unchanged for 3 consecutive checks (3 seconds).
171+
* Checks are performed every 1 second.
169172
* @param editor The TextEditor instance
170-
* @param timeout Maximum time to wait in milliseconds (default: 15000)
173+
* @param timeout Maximum time to wait in milliseconds (default: 15000). Function will throw an error if generation takes longer than this timeout.
171174
* @returns Promise<void>
172-
* @throws Error if timeout is exceeded
175+
* @throws Error if timeout is exceeded before a stable state is reached
173176
*/
174177
export async function waitForInlineGeneration(editor: TextEditor, timeout = 15000): Promise<void> {
175178
const startTime = Date.now()

0 commit comments

Comments
 (0)