Build an AsyncCodeModeContext with a document snapshot from the kernel.
(k: Kernel)
| 38 | |
| 39 | @contextmanager |
| 40 | def _ctx(k: Kernel) -> Generator[AsyncCodeModeContext, None, None]: |
| 41 | """Build an AsyncCodeModeContext with a document snapshot from the kernel.""" |
| 42 | doc = NotebookDocument( |
| 43 | [ |
| 44 | NotebookCell(id=cid, code=cell.code, name="", config=cell.config) |
| 45 | for cid, cell in k.graph.cells.items() |
| 46 | ] |
| 47 | ) |
| 48 | with notebook_document_context(doc): |
| 49 | yield AsyncCodeModeContext(k) |
| 50 | |
| 51 | |
| 52 | class TestCellsViewIndex: |
no test coverage detected
searching dependent graphs…