Expand description
Shared headless apply path for symbol-body edits (spec v2a §5.1).
local_range_write is the Trait-default for replace_symbol_body /
insert_before_symbol / insert_after_symbol: it writes a resolved range
to disk atomically, so edits work without any running language server / IDE.
JetBrainsHttpBackend overrides the Trait methods with the in-IDE HTTP path;
both paths apply the same tree-sitter range → byte-identical result.
Structs§
- Headless
Backend - Zero-dependency backend that carries only the Trait default-apply for the three edit methods (used by ctx_refactor when no IDE is reachable). The five mandatory read methods are unsupported here (edits never call them).
Functions§
- local_
range_ write - Apply a resolved
RangeEditto disk (headless). Reads the file, optionally verifiesexpected_hashagainst the current bytes covered byrange(mismatch →CONFLICT), replaces the range withtext, writes atomically, and returns the post-edit range + a compact diff. - offset_
of - Convert a 0-based (line, character) coordinate to a byte offset into
content.line/charactercount UTF-8 bytes per line (wire convention here is byte columns, matching how Rust slices&str). Out-of-range →Err. - overview_
from_ index - Build a file’s structure overview from the tree-sitter symbol index
(headless
symbols_overviewdefault, spec v2a §5.2). Best-effort: returns an empty vec when no graph is available.