mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
kill text utils
This commit is contained in:
parent
f553837c1c
commit
921689b70d
4 changed files with 13 additions and 19 deletions
|
@ -28,4 +28,11 @@ impl AtomTextEdit {
|
|||
pub fn insert(offset: TextUnit, text: String) -> AtomTextEdit {
|
||||
AtomTextEdit::replace(TextRange::offset_len(offset, 0.into()), text)
|
||||
}
|
||||
|
||||
pub fn apply(&self, mut text: String) -> String {
|
||||
let start = u32::from(self.delete.start()) as usize;
|
||||
let end = u32::from(self.delete.end()) as usize;
|
||||
text.replace_range(start..end, &self.insert);
|
||||
text
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue