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:
Ville Penttinen 2019-03-25 09:03:10 +02:00
parent 22e1c7a112
commit b92fcbc956
4 changed files with 50 additions and 27 deletions

View file

@ -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)]