mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
create separated mod for reparsing functionality
This commit is contained in:
parent
bc94bf95ce
commit
a29211918b
3 changed files with 200 additions and 170 deletions
|
@ -17,3 +17,10 @@ pub fn intersect(r1: TextRange, r2: TextRange) -> Option<TextRange> {
|
|||
None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn replace_range(mut text: String, range: TextRange, replace_with: &str) -> String {
|
||||
let start = u32::from(range.start()) as usize;
|
||||
let end = u32::from(range.end()) as usize;
|
||||
text.replace_range(start..end, replace_with);
|
||||
text
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue