Skip to content

Commit 3091439

Browse files
update
1 parent 663a180 commit 3091439

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/cursorless-vscode-e2e/src/suite/crossCellsSetSelection.vscode.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { sleep } from "@cursorless/common";
12
import {
23
getCursorlessApi,
34
openNewNotebookEditor,
@@ -19,6 +20,8 @@ async function runTest() {
1920

2021
await openNewNotebookEditor(['"hello"', '"world"']);
2122

23+
await sleep(200);
24+
2225
await hatTokenMap.allocateHats();
2326

2427
await runCursorlessCommand({

packages/vscode-common/src/testUtil/openNewEditor.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,19 +98,18 @@ export async function openNewNotebookEditor(
9898

9999
// FIXME: There seems to be some timing issue when you create a notebook
100100
// editor
101-
await waitForEditorToOpen(cellContents.length);
101+
await waitForEditorToOpen();
102102

103103
return document;
104104
}
105105

106-
function waitForEditorToOpen(numCells: number): Promise<void> {
106+
function waitForEditorToOpen(): Promise<void> {
107107
return new Promise<void>((resolve, reject) => {
108108
let count = 0;
109109
const interval = setInterval(() => {
110110
if (vscode.window.activeTextEditor != null) {
111111
clearInterval(interval);
112-
// Give it a moment to settle
113-
setTimeout(resolve, 100 * numCells);
112+
resolve();
114113
} else {
115114
count++;
116115
if (count === 20) {

0 commit comments

Comments
 (0)