pub fn presentation_style_changed(
original: &str,
new_text: &str,
format: &FileFormat,
) -> boolExpand description
Serialize a value back to its original format, preserving comments and formatting for TOML and YAML files.
For TOML, the original text is re-parsed with toml_edit::DocumentMut
(which retains comments and whitespace), and only the paths that differ
between old_value and new_value are updated. Untouched keys keep
their original formatting, inline comments, and section ordering.
For YAML, the original text is re-parsed with yaml_edit::Document
(a Rowan-based CST that retains comments and whitespace), and only the
paths that differ between old_value and new_value are updated.
JSON falls through to serialize_value (JSON has no comments).
True when write text changed presentation style (e.g. YAML block-sequence
indent collapsed) while values may still be correct (#2070 honesty).
Agents must not claim a pure surgical text edit when this is true.