ide на основе vs code
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
Это ide на основе vs code(code oss), в ней будет встроенный умный апи роутинг, свой маркет с плагинами(агент харнесс, поддержка java/kotlin/мобильной разработки, командная разработка проектов, orca, оркестратор агентов
--- description: Architecture documentation for VS Code notebook and interactive window components. Use when working in src/vs/workbench/contrib/notebook/ ---
This document describes the internal architecture of VS Code's notebook implementation.
Notebook model resolution is handled by NotebookService. It resolves notebook models from the file system or other sources. The notebook model is a tree of cells, where each cell has a type (code or markdown) and a list of outputs.
The notebook viewport is virtualized to improve performance. Only visible cells are rendered, and cells outside the viewport are recycled. The viewport rendering is handled by NotebookCellList which extends WorkbenchList<CellViewModel>.
!Viewport Rendering
The rendering has the following steps:
1. Render Viewport - Layout/render only the cells that are in the visible viewport 2. Render Template - Each cell type has a template (code cell, markdown cell) that is instantiated via CodeCellRenderer or MarkupCellRenderer 3. Render Element - The cell content is rendered into the template 4. Get Dynamic Height - Cell height is computed dynamically based on content (editor lines, outputs, etc.) 5. Cell Parts Lifecycle - Each cell has lifecycle parts that manage focus, selection, and other state
When a cell above the viewport is resized (e.g., output grows), the viewport needs to be updated to maintain scroll position. This is handled by tracking scroll anchors.
!Cell Resize Above Viewport
The notebook editor renders cells through a contribution system. Cell parts are organized into two categories via CellPartsCollection:
prepareRenderCell() - Prepare model (no DOM operations)renderCell() / didRenderCell() - Update DOM for the cellunrenderCell() - Cleanup when cell leaves viewportupdateInternalLayoutNow() - Update layout per cell layout changesupdateState() - Update per cell state changeupdateForExecutionState() - Update per execution state changeCell parts are located in view/cellParts/ and contribute to different aspects:
CellDragAndDropControllerFocus in the notebook editor is complex because there are multiple focusable elements:
1. The notebook list itself (NotebookCellList) 2. Individual cell containers 3. Monaco editors within cells 4. Output elements (webviews via BackLayerWebView)
The NotebookEditorWidget tracks focus state and provides APIs to manage focus across these components. Context keys like NOTEBOOK_EDITOR_FOCUSED, NOTEBOOK_OUTPUT_FOCUSED, and NOTEBOOK_OUTPUT_INPUT_FOCUSED are used to track focus state.
Large outputs are virtualized similar to cells. Only visible portions of outputs are rendered.
Cell DOM elements are pooled and recycled to reduce DOM operations. When scrolling, cells that move out of the viewport have their templates returned to the pool. Editor instances are managed via NotebookCellEditorPool.
Output webviews are reused across cells when possible to reduce the overhead of creating new webview contexts. The BackLayerWebView manages the webview lifecycle.
---
The notebook find feature supports searching in both text models and rendered outputs. The find functionality is implemented via FindModel and CellFindMatchModel classes.
For rendered outputs (HTML, images with alt text, etc.), the find uses a hybrid approach:
1. Text model search - Searches cell source code using standard text search via FindMatch 2. DOM search in webview - Uses window.find() to search rendered output content via CellWebviewFindMatch
!Hybrid Find
The hybrid find works by:
1. First finding matches in text models (cell inputs) - stored in contentMatches 2. Then finding matches in rendered outputs via webview - stored in webviewMatches 3. Mixing both match types into a unified result set via CellFindMatchModel 4. Navigating between matches reveals the appropriate editor or output
window.find() for DOM searching in webviewdocument.execCommand('hiliteColor') to highlight matchesdocument.getSelection() to get match positions