mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-22 19:34:16 +00:00
internal: remove one more syntax rewriter
This commit is contained in:
parent
4e3f0186d8
commit
1fdc9d8e9e
3 changed files with 38 additions and 65 deletions
|
@ -125,8 +125,11 @@ pub fn remove_all_iter(range: impl IntoIterator<Item = SyntaxElement>) {
|
|||
}
|
||||
|
||||
pub fn replace(old: impl Element, new: impl Element) {
|
||||
replace_with_many(old, vec![new.syntax_element()])
|
||||
}
|
||||
pub fn replace_with_many(old: impl Element, new: Vec<SyntaxElement>) {
|
||||
let old = old.syntax_element();
|
||||
replace_all(old.clone()..=old, vec![new.syntax_element()])
|
||||
replace_all(old.clone()..=old, new)
|
||||
}
|
||||
pub fn replace_all(range: RangeInclusive<SyntaxElement>, new: Vec<SyntaxElement>) {
|
||||
let start = range.start().index();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue