Expand description
§DiffRenderer (experimental_)
Runtime-agnostic diff-rendering trait. Plugins implement this to provide syntax-aware diff rendering; the host calls it without knowing whether the implementation is Lua, WASM, or native.
§Stability
This trait is experimental as of SDK 0.3. Once progit-syntax-diff v0.1
ships and exercises the API in production, it will be promoted to the
stable traits::DiffRenderer namespace.
§Trait firewall
Implementations of this trait may be backed by Lua or WASM, but the trait
itself MUST NOT reference mlua::* or wasmtime::* types. The TUI calls
a Box<dyn DiffRenderer> and never sees the runtime.
§Design rationale
DiffRequestcarries content, never paths — plugins do not perform I/O.DiffResponseis fully serializable — crosses the Lua/WASM boundary as JSON without callbacks or closures.TokenSpanreuse — diff coloring is a specialized case of token highlighting plus line-kind metadata.max_linestruncation rather than streaming callbacks — Lua has no native async; the host callsrenderagain with a larger budget for incremental display.
Structs§
- Diff
Line - One rendered line.
- Diff
Request - Patch / diff input.
- Diff
Response - Render result. A sequence of styled lines the host can render directly.
Enums§
- Diff
Line Kind - Diff
View - Render style.
Traits§
- Diff
Renderer - The runtime-agnostic trait the TUI calls.