Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-db/src/source_change.rs')
-rw-r--r--crates/ide-db/src/source_change.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ide-db/src/source_change.rs b/crates/ide-db/src/source_change.rs
index 766d7251a1..72683c9512 100644
--- a/crates/ide-db/src/source_change.rs
+++ b/crates/ide-db/src/source_change.rs
@@ -264,7 +264,7 @@ impl SourceChangeBuilder {
}
pub fn make_editor(&self, node: &SyntaxNode) -> SyntaxEditor {
- SyntaxEditor::new(node.ancestors().last().unwrap_or_else(|| node.clone())).0
+ SyntaxEditor::new(node.tree_top()).0
}
pub fn add_file_edits(&mut self, file_id: impl Into<FileId>, editor: SyntaxEditor) {