aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-09-18 22:46:10 +0100
committerAleksey Kladov <[email protected]>2018-09-18 22:46:10 +0100
commitd6c7030aeb084106a3c4bae765731421e8ac1dbd (patch)
treeca4448b02f4ba654243addba4785ff82d225a824 /crates/ra_syntax/src
parent79293d2593ba658243d0f2edf18cd283fa40447a (diff)
Add emacs function for extend shirnk selection
Diffstat (limited to 'crates/ra_syntax/src')
-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()