diff options
Diffstat (limited to 'crates/syntax/src/ast.rs')
-rw-r--r-- | crates/syntax/src/ast.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/syntax/src/ast.rs b/crates/syntax/src/ast.rs index b3a24d39d..19261686c 100644 --- a/crates/syntax/src/ast.rs +++ b/crates/syntax/src/ast.rs | |||
@@ -6,6 +6,7 @@ mod token_ext; | |||
6 | mod node_ext; | 6 | mod node_ext; |
7 | mod expr_ext; | 7 | mod expr_ext; |
8 | pub mod edit; | 8 | pub mod edit; |
9 | pub mod edit_in_place; | ||
9 | pub mod make; | 10 | pub mod make; |
10 | 11 | ||
11 | use std::marker::PhantomData; | 12 | use std::marker::PhantomData; |
@@ -40,6 +41,12 @@ pub trait AstNode { | |||
40 | Self: Sized; | 41 | Self: Sized; |
41 | 42 | ||
42 | fn syntax(&self) -> &SyntaxNode; | 43 | fn syntax(&self) -> &SyntaxNode; |
44 | fn clone_for_update(&self) -> Self | ||
45 | where | ||
46 | Self: Sized, | ||
47 | { | ||
48 | Self::cast(self.syntax().clone_for_update()).unwrap() | ||
49 | } | ||
43 | } | 50 | } |
44 | 51 | ||
45 | /// Like `AstNode`, but wraps tokens rather than interior nodes. | 52 | /// Like `AstNode`, but wraps tokens rather than interior nodes. |