mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-10 21:58:37 +00:00
fix: Deduplicate annotations
This commit is contained in:
parent
ae2c3223b0
commit
002e611d09
7 changed files with 179 additions and 182 deletions
|
@ -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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue