Context
Issue #47's title demands "the richest features set". The competitor survey
(competitors-code-tooling.md) ranks
incremental re-parse with subtree reuse (tree-sitter) and red/green persistent
trees with structure sharing (Roslyn, rowan/Biome) as the top capabilities
meta-language lacks; difftastic adds structural snapshot diffing. Today every
edit re-parses from scratch. See
solution-plans.md S-13.
Scope
- Expose tree-sitter's native incremental parsing (
InputEdit + previous
tree) through src/tree_sitter_adapter.rs:
LinkNetwork::apply_edit(range, new_text) re-parses only affected regions;
link ids outside the edited span stay stable.
- Extend
NetworkSnapshot so an edited fork shares unchanged links with its
parent (rowan/cstree precedent), with a test measuring sharing.
- Structural diff between two snapshots returning changed/added/removed link
sets (difftastic precedent) - this also gives transforms a cheap dry-run
preview.
Acceptance criteria
References
Filed from docs/case-studies/issue-47/proposed-issues/13-incremental-reparse-structural-sharing.md. Part of the implementation plan for #47.
Context
Issue #47's title demands "the richest features set". The competitor survey
(
competitors-code-tooling.md) ranksincremental re-parse with subtree reuse (tree-sitter) and red/green persistent
trees with structure sharing (Roslyn, rowan/Biome) as the top capabilities
meta-language lacks; difftastic adds structural snapshot diffing. Today every
edit re-parses from scratch. See
solution-plans.mdS-13.Scope
InputEdit+ previoustree) through
src/tree_sitter_adapter.rs:LinkNetwork::apply_edit(range, new_text)re-parses only affected regions;link ids outside the edited span stay stable.
NetworkSnapshotso an edited fork shares unchanged links with itsparent (rowan/cstree precedent), with a test measuring sharing.
sets (difftastic precedent) - this also gives transforms a cheap dry-run
preview.
Acceptance criteria
apply_editproduces a network equal to a from-scratch parse of theedited text (byte-exact reconstruction) while preserving ids outside
the edit.
bump: minor).References
requirements.mdR-2 contextsolution-plans.mdS-13issue-47-76af108c0f24(PR Finish issue #47 parity feature set #48).Filed from
docs/case-studies/issue-47/proposed-issues/13-incremental-reparse-structural-sharing.md. Part of the implementation plan for #47.