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

Function closeInteractiveWindow

src/test/datascience/helpers.ts:194–207  ·  view source on GitHub ↗
(interactiveWindow: IInteractiveWindow)

Source from the content-addressed store, hash-verified

192}
193
194export 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
209export async function waitForInteractiveWindow(
210 interactiveWindow: IInteractiveWindow

Calls 3

sleepFunction · 0.90
executeCommandMethod · 0.65
disposeMethod · 0.65

Tested by

no test coverage detected