From 35e77f6993d26ec546b86aaea15df116be1283a5 Mon Sep 17 00:00:00 2001 From: Barry Jaspan Date: Mon, 11 Dec 2023 18:28:01 -0500 Subject: [PATCH] Remove cyclic dependency between notebook.ts and notebookLegacy.ts. (#2122) Once `isVscodeLegacyNotebookVersion` has determined that `getNotebookFromCellDocument` should call `getNotebookFromCellDocumentLegacy`, there is no need for `getNotebookFromCellDocumentLegacy` to determine that again, and doing so forces a cyclic import dependency. Co-authored-by: Barry Jaspan --- .../src/ide/vscode/notebook/notebookLegacy.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/cursorless-vscode/src/ide/vscode/notebook/notebookLegacy.ts b/packages/cursorless-vscode/src/ide/vscode/notebook/notebookLegacy.ts index e5599929d8..a33115a911 100644 --- a/packages/cursorless-vscode/src/ide/vscode/notebook/notebookLegacy.ts +++ b/packages/cursorless-vscode/src/ide/vscode/notebook/notebookLegacy.ts @@ -4,7 +4,6 @@ import { commands, NotebookDocument, TextDocument } from "vscode"; import { toVscodeEditor } from "../toVscodeEditor"; import type { VscodeIDE } from "../VscodeIDE"; import type { VscodeTextEditorImpl } from "../VscodeTextEditorImpl"; -import { getNotebookFromCellDocument } from "./notebook"; export async function focusNotebookCellLegacy( ide: VscodeIDE, @@ -18,10 +17,10 @@ export async function focusNotebookCellLegacy( const vscodeActiveEditor = toVscodeEditor(activeTextEditor); - const editorNotebook = getNotebookFromCellDocument( + const editorNotebook = getNotebookFromCellDocumentLegacy( editor.vscodeEditor.document, ); - const activeEditorNotebook = getNotebookFromCellDocument( + const activeEditorNotebook = getNotebookFromCellDocumentLegacy( vscodeActiveEditor.document, );