Status: resolved · Related: Rust Lossless Syntax and Patches

Problem

A graph-side declaration rename does not update references. Reusing LSP Rename can return edits for several files, but the graph preview/undo contract currently covers one document. Keeping only the origin’s edits would silently break callers.

Options

approachproscons
AApply local subsetsmallincomplete refactoring, broken references
BAccept complete single-file plans onlyexisting guarded history/previewrefuses multi-file rename
CMulti-document proposalfull featureneeds explicit undo and partial-save policy

Measurements

Focused unit tests cover exact Unicode/CRLF plans and grouped history, URI aliases, other-file and version-only targets, stale versions, duplicate/overlapping ranges, surrogate boundaries, empty plans and budgets. The graph-rename browser suite uses real rust-analyzer and both existing editor backends; final evidence is in the handoff.

Decision

Choose B for this slice. Check the complete LSP response before proposing edits; reject any other-file target, unsupported resource edit or stale response. Keep A unavailable. C remains future work. No autosave or new source transaction.

Lesson

A single-document preview may accept only a complete single-document refactoring. The current document alone is insufficient for async freshness: also check the server connection/version and open buffers used by the resolver.

2026-10-16 follow-up: option C is now implemented for complete plans within one writable folder source, with coordinated history and separate per-file saves. The incomplete-subset prohibition still holds. See P-210 Multi-document rename needs coordinated history.