fix: Deduplicate annotations

This commit is contained in:
Lukas Wirth 2023-12-19 08:30:48 +01:00
parent ae2c3223b0
commit 002e611d09
7 changed files with 179 additions and 182 deletions

View file

@ -516,7 +516,7 @@ fn source_edit_from_def(
if let Definition::Local(local) = def {
let mut file_id = None;
for source in local.sources(sema.db) {
let source = match source.source.clone().original_ast_node(sema.db) {
let source = match source.source.clone().original_ast_node_rooted(sema.db) {
Some(source) => source,
None => match source
.source
@ -560,7 +560,7 @@ fn source_edit_from_def(
}
} else {
// Foo { ref mut field } -> Foo { field: ref mut new_name }
// ^ insert `field: `
// original_ast_node_rootedd: `
// ^^^^^ replace this with `new_name`
edit.insert(
pat.syntax().text_range().start(),