aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/algo/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/algo/mod.rs')
-rw-r--r--crates/ra_syntax/src/algo/mod.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/ra_syntax/src/algo/mod.rs b/crates/ra_syntax/src/algo/mod.rs
index 7287f5bb2..8de44c586 100644
--- a/crates/ra_syntax/src/algo/mod.rs
+++ b/crates/ra_syntax/src/algo/mod.rs
@@ -78,7 +78,11 @@ impl<'f> Iterator for LeafAtOffset<'f> {
78} 78}
79 79
80pub fn find_covering_node(root: SyntaxNodeRef, range: TextRange) -> SyntaxNodeRef { 80pub fn find_covering_node(root: SyntaxNodeRef, range: TextRange) -> SyntaxNodeRef {
81 assert!(is_subrange(root.range(), range)); 81 assert!(
82 is_subrange(root.range(), range),
83 "node range: {:?}, target range: {:?}",
84 root.range(), range,
85 );
82 let (left, right) = match ( 86 let (left, right) = match (
83 find_leaf_at_offset(root, range.start()).right_biased(), 87 find_leaf_at_offset(root, range.start()).right_biased(),
84 find_leaf_at_offset(root, range.end()).left_biased() 88 find_leaf_at_offset(root, range.end()).left_biased()