aboutsummaryrefslogtreecommitdiff
path: root/crates/syntax/src/ast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/syntax/src/ast.rs')
-rw-r--r--crates/syntax/src/ast.rs7
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;
6mod node_ext; 6mod node_ext;
7mod expr_ext; 7mod expr_ext;
8pub mod edit; 8pub mod edit;
9pub mod edit_in_place;
9pub mod make; 10pub mod make;
10 11
11use std::marker::PhantomData; 12use 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.