diff options
Diffstat (limited to 'crates/ra_syntax/src/ptr.rs')
-rw-r--r-- | crates/ra_syntax/src/ptr.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/ptr.rs b/crates/ra_syntax/src/ptr.rs index ecbfffcf4..62f03e93d 100644 --- a/crates/ra_syntax/src/ptr.rs +++ b/crates/ra_syntax/src/ptr.rs | |||
@@ -24,7 +24,7 @@ impl SyntaxNodePtr { | |||
24 | pub fn to_node(&self, root: &SyntaxNode) -> SyntaxNode { | 24 | pub fn to_node(&self, root: &SyntaxNode) -> SyntaxNode { |
25 | assert!(root.parent().is_none()); | 25 | assert!(root.parent().is_none()); |
26 | successors(Some(root.clone()), |node| { | 26 | successors(Some(root.clone()), |node| { |
27 | node.children().find(|it| self.range.is_subrange(&it.text_range())) | 27 | node.children().find(|it| it.text_range().contains_range(self.range)) |
28 | }) | 28 | }) |
29 | .find(|it| it.text_range() == self.range && it.kind() == self.kind) | 29 | .find(|it| it.text_range() == self.range && it.kind() == self.kind) |
30 | .unwrap_or_else(|| panic!("can't resolve local ptr to SyntaxNode: {:?}", self)) | 30 | .unwrap_or_else(|| panic!("can't resolve local ptr to SyntaxNode: {:?}", self)) |