mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
internal: replace AstTransformer with mutable syntax trees
This commit is contained in:
parent
3cfe2d0a5d
commit
47d7434dde
6 changed files with 123 additions and 208 deletions
|
@ -239,6 +239,16 @@ impl ast::TypeBoundList {
|
|||
}
|
||||
}
|
||||
|
||||
impl ast::PathSegment {
|
||||
pub fn get_or_create_generic_arg_list(&self) -> ast::GenericArgList {
|
||||
if self.generic_arg_list().is_none() {
|
||||
let arg_list = make::generic_arg_list().clone_for_update();
|
||||
ted::append_child(self.syntax(), arg_list.syntax())
|
||||
}
|
||||
self.generic_arg_list().unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::UseTree {
|
||||
pub fn remove(&self) {
|
||||
for &dir in [Direction::Next, Direction::Prev].iter() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue