MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / waitForLastCellToComplete

Function waitForLastCellToComplete

src/test/datascience/helpers.ts:246–270  ·  view source on GitHub ↗
(
    interactiveWindow: InteractiveWindow,
    numberOfCells: number = -1,
    errorsOkay?: boolean
)

Source from the content-addressed store, hash-verified

244}
245
246export async function waitForLastCellToComplete(
247 interactiveWindow: InteractiveWindow,
248 numberOfCells: number = -1,
249 errorsOkay?: boolean
250) {
251 const notebookDocument = await waitForInteractiveWindow(interactiveWindow);
252 let codeCell: vscode.NotebookCell | undefined;
253 let codeCells: vscode.NotebookCell[] = [];
254 await waitForCondition(
255 async () => {
256 codeCells = notebookDocument?.getCells().filter((c) => c.kind === vscode.NotebookCellKind.Code);
257 codeCell = codeCells && codeCells.length ? codeCells[codeCells.length - 1] : undefined;
258 return codeCell && (numberOfCells === -1 || numberOfCells === codeCells!.length) ? true : false;
259 },
260 defaultNotebookTestTimeout,
261 `No code cell found in interactive window notebook document`
262 );
263 if (errorsOkay) {
264 await waitForCellExecutionToComplete(codeCell!);
265 } else {
266 await waitForExecutionCompletedSuccessfully(codeCell!);
267 }
268 logger.ci(`finished waiting for last cell to complete of ${codeCells.length} cells`);
269 return codeCell!;
270}
271
272export async function waitForCodeLenses(document: vscode.Uri, command: string) {
273 // First make sure the editor has focus

Calls 7

waitForConditionFunction · 0.90
waitForInteractiveWindowFunction · 0.85
filterMethod · 0.80
getCellsMethod · 0.80
ciMethod · 0.65

Tested by

no test coverage detected