Skip to content

Commit a9ca3b1

Browse files
committed
rename var to be more consistent with queue-like purpose
1 parent 3e11dd3 commit a9ca3b1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/core/src/test/testUtil.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -490,20 +490,20 @@ export async function closeAllEditors(): Promise<void> {
490490
/amazonwebservices\.[a-z\-]+-vscode\./,
491491
/nullExtensionDescription./, // Sometimes exists instead of the prior line, see https://github.com/aws/aws-toolkit-vscode/issues/4658
492492
]
493-
const visibleEditors: vscode.TextEditor[] = []
493+
const editorsToClose: vscode.TextEditor[] = []
494494

495495
const noVisibleEditor: boolean | undefined = await waitUntil(
496496
async () => {
497497
// Race: documents could appear after the call to closeAllEditors(), so retry.
498498
await vscode.commands.executeCommand(closeAllCmd)
499-
visibleEditors.length = 0
500-
visibleEditors.push(
499+
editorsToClose.length = 0
500+
editorsToClose.push(
501501
...vscode.window.visibleTextEditors.filter(
502502
(editor) => !ignorePatterns.some((p) => p.test(editor.document.fileName))
503503
)
504504
)
505505

506-
return visibleEditors.length === 0
506+
return editorsToClose.length === 0
507507
},
508508
{
509509
timeout: 1000, // Arbitrary values. Should succeed except when VS Code is lagging heavily.
@@ -512,8 +512,8 @@ export async function closeAllEditors(): Promise<void> {
512512
}
513513
)
514514

515-
if (!noVisibleEditor && visibleEditors.length > 0) {
516-
const editorNames = visibleEditors.map((editor) => `\t${editor.document.fileName}`)
515+
if (!noVisibleEditor && editorsToClose.length > 0) {
516+
const editorNames = editorsToClose.map((editor) => `\t${editor.document.fileName}`)
517517
throw new Error(`Editors were still open after closeAllEditors():\n${editorNames.join('\n')}`)
518518
}
519519
}

0 commit comments

Comments
 (0)