(
interactiveWindow: InteractiveWindow,
numberOfCells: number = -1,
errorsOkay?: boolean
)
| 244 | } |
| 245 | |
| 246 | export 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 | |
| 272 | export async function waitForCodeLenses(document: vscode.Uri, command: string) { |
| 273 | // First make sure the editor has focus |
no test coverage detected