Replaces a source range and returns a newly parsed syntax tree, preserving all text outside the range.
public YamlSyntaxTree WithTextChange(int start, int length, string newText)
The zero-based UTF-16 character index at which to apply the change.
The number of characters to replace. Use zero to insert text.
The replacement YAML source text. Use an empty string to delete text.
The original tree is unchanged. Replacement text is raw YAML, not a CLR scalar value; callers must supply any required quoting, escaping, and indentation. The complete result is reparsed and validated. For successive edits, use offsets from the latest tree.