Skip to main content

sync_sidecar

Function sync_sidecar 

Source
pub fn sync_sidecar(
    old_xml: &str,
    new_annotations: &[Annotation],
) -> Vec<SidecarEdit>
Expand description

Compute minimal edits to sync an .aqm sidecar with new annotations.

Matches elements by bind attribute. Produces edits for:

  • Renamed bindings (bind attr value changed) — not applicable (bind is the key)
  • Added annotations — appended at end
  • Removed annotations — element deleted
  • Attribute changes on existing elements — element replaced

Returns edits sorted by start_byte descending (apply back-to-front).