aboutsummaryrefslogtreecommitdiff
path: root/crates/syntax/src/ptr.rs
diff options
context:
space:
mode:
authorIgor Aleksanov <[email protected]>2020-10-03 15:34:52 +0100
committerIgor Aleksanov <[email protected]>2020-10-12 09:04:59 +0100
commite24e22f288eba33928a9e579f13653d6f04fcdfa (patch)
tree4fd9d128cf510dd7478f6a1fd955461cca70d2f4 /crates/syntax/src/ptr.rs
parent17f1026c46e6e3797caf3c69737f66bd612c58e1 (diff)
Add fix for incorrect case diagnostic
Diffstat (limited to 'crates/syntax/src/ptr.rs')
-rw-r--r--crates/syntax/src/ptr.rs4
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| {