Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/syntax/src/syntax_editor/edit_algo.rs')
-rw-r--r--crates/syntax/src/syntax_editor/edit_algo.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/syntax/src/syntax_editor/edit_algo.rs b/crates/syntax/src/syntax_editor/edit_algo.rs
index 71b03784e9..d24d9b1334 100644
--- a/crates/syntax/src/syntax_editor/edit_algo.rs
+++ b/crates/syntax/src/syntax_editor/edit_algo.rs
@@ -200,6 +200,9 @@ impl EditPlan {
}
/// Checks that replacement at the same tree depth do not overlap
+ ///
+ /// `changes` is sorted by range start, so overlap is a single comparison against the
+ /// last range at that key, and `insert` can throw away the range it evicts.
fn replacements_are_disjoint(
changes: &[Change],
mut node_depth: impl FnMut(SyntaxNode) -> usize,