in ApplyEditsToSourceText() (BaseSyntaxElements.cs:302), I implemented a check to ensure that two edits do not overlap; otherwise, the resulting code would be invalid. For example, if one edit replaces a function with an empty string, effectively removing it, and another edit attempts to add a variable inside the removed function, the code would break.
(or maybe it's better to directly embed code text inside syntax node?)