(interactiveWindow: IInteractiveWindow)
| 192 | } |
| 193 | |
| 194 | export async function closeInteractiveWindow(interactiveWindow: IInteractiveWindow) { |
| 195 | if (interactiveWindow.notebookDocument) { |
| 196 | const editor = vscode.window.visibleNotebookEditors.find( |
| 197 | (n) => n.notebook === interactiveWindow.notebookDocument |
| 198 | ); |
| 199 | if (editor) { |
| 200 | await vscode.commands.executeCommand('workbench.action.focusSecondEditorGroup'); |
| 201 | await vscode.commands.executeCommand('interactive.input.focus'); |
| 202 | await vscode.commands.executeCommand('workbench.action.closeActiveEditor'); |
| 203 | await sleep(500); // Seems to be some flakiness in VS code closing a window. |
| 204 | } |
| 205 | interactiveWindow.dispose(); |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | export async function waitForInteractiveWindow( |
| 210 | interactiveWindow: IInteractiveWindow |
no test coverage detected