diff options
Diffstat (limited to 'crates/syntax')
-rw-r--r-- | crates/syntax/src/ptr.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crates/syntax/src/ptr.rs b/crates/syntax/src/ptr.rs index d3fb7a5d9..34e20464a 100644 --- a/crates/syntax/src/ptr.rs +++ b/crates/syntax/src/ptr.rs | |||
@@ -23,6 +23,10 @@ impl SyntaxNodePtr { | |||
23 | SyntaxNodePtr { range: node.text_range(), kind: node.kind() } | 23 | SyntaxNodePtr { range: node.text_range(), kind: node.kind() } |
24 | } | 24 | } |
25 | 25 | ||
26 | pub fn text_range(&self) -> TextRange { | ||
27 | self.range.clone() | ||
28 | } | ||
29 | |||
26 | pub fn to_node(&self, root: &SyntaxNode) -> SyntaxNode { | 30 | pub fn to_node(&self, root: &SyntaxNode) -> SyntaxNode { |
27 | assert!(root.parent().is_none()); | 31 | assert!(root.parent().is_none()); |
28 | successors(Some(root.clone()), |node| { | 32 | successors(Some(root.clone()), |node| { |