mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Further improvements to the SourceChange convenience methods
Rename system_edit to file_system_edit, add more documentation, add source_file_edit_from to create a SourceChange from `FileId` and `TextEdit`.
This commit is contained in:
parent
22e1c7a112
commit
b92fcbc956
4 changed files with 50 additions and 27 deletions
|
@ -187,12 +187,7 @@ fn rename_mod(
|
|||
};
|
||||
source_file_edits.push(edit);
|
||||
|
||||
Some(SourceChange {
|
||||
label: "rename".to_string(),
|
||||
source_file_edits,
|
||||
file_system_edits,
|
||||
cursor_position: None,
|
||||
})
|
||||
Some(SourceChange::from_edits("rename", source_file_edits, file_system_edits))
|
||||
}
|
||||
|
||||
fn rename_reference(
|
||||
|
@ -211,12 +206,7 @@ fn rename_reference(
|
|||
return None;
|
||||
}
|
||||
|
||||
Some(SourceChange {
|
||||
label: "rename".to_string(),
|
||||
source_file_edits: edit,
|
||||
file_system_edits: Vec::new(),
|
||||
cursor_position: None,
|
||||
})
|
||||
Some(SourceChange::source_edits("rename", edit))
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue