Skip to content

Commit 663a180

Browse files
Clean up
1 parent 38bf287 commit 663a180

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

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

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

103103
return document;
104104
}
105105

106-
function waitForEditorToOpen() {
106+
function waitForEditorToOpen(numCells: number): 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);
112112
// Give it a moment to settle
113-
setTimeout(resolve, 200);
113+
setTimeout(resolve, 100 * numCells);
114114
} else {
115115
count++;
116116
if (count === 20) {

0 commit comments

Comments
 (0)