Skip to main content

Module editor_access

Module editor_access 

Source
Expand description

AG-2a: the concrete editor-capability handle for the read surface.

EditorAccess composes generic services — the crate-owned [EditorStateCache] and the generic BufferStore (on-demand text / dirty) — into Rust-typed answers for current_selection / open_editors / workspace_folders / document_dirty. It carries no wire-protocol shape (no JSON, no MCP envelope): that translation is each adapter’s job (lattice_ai::mcp::reads, and lattice-ai’s ACP mapping).

Not a trait — one implementation exists. Tests construct it over in-memory seams (an EditorStateCache built directly from events), mirroring the pre-port ctx_with test helper.

Structs§

EditorAccess
The concrete editor-capability handle. Clone-able (all fields are cheap handles), shared between agent tasks off the editor thread.
OpenEditor
SelectionInfo
The active selection plus the text it covers.

Functions§

ordered
(start, end) in document order. Used by adapters building a selection result (lattice_ai::mcp::reads::selection_result) as well as internally by [slice_selection].
path_to_uri
A file:// URI for path. Used by adapters building a selection result (lattice_ai::mcp::reads::selection_result) alongside file_path.