mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-08-19 18:10:25 +00:00
Upgrade rowan
Notably, new rowan comes with support for mutable syntax trees.
This commit is contained in:
parent
62ec04bbd5
commit
f5a81ec468
41 changed files with 376 additions and 176 deletions
|
@ -6,6 +6,7 @@ mod token_ext;
|
|||
mod node_ext;
|
||||
mod expr_ext;
|
||||
pub mod edit;
|
||||
pub mod edit_in_place;
|
||||
pub mod make;
|
||||
|
||||
use std::marker::PhantomData;
|
||||
|
@ -40,6 +41,12 @@ pub trait AstNode {
|
|||
Self: Sized;
|
||||
|
||||
fn syntax(&self) -> &SyntaxNode;
|
||||
fn clone_for_update(&self) -> Self
|
||||
where
|
||||
Self: Sized,
|
||||
{
|
||||
Self::cast(self.syntax().clone_for_update()).unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
/// Like `AstNode`, but wraps tokens rather than interior nodes.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue