mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-18 08:10:11 +00:00
Add emacs function for extend shirnk selection
This commit is contained in:
parent
79293d2593
commit
d6c7030aeb
4 changed files with 123 additions and 3 deletions
|
@ -78,7 +78,11 @@ impl<'f> Iterator for LeafAtOffset<'f> {
|
|||
}
|
||||
|
||||
pub fn find_covering_node(root: SyntaxNodeRef, range: TextRange) -> SyntaxNodeRef {
|
||||
assert!(is_subrange(root.range(), range));
|
||||
assert!(
|
||||
is_subrange(root.range(), range),
|
||||
"node range: {:?}, target range: {:?}",
|
||||
root.range(), range,
|
||||
);
|
||||
let (left, right) = match (
|
||||
find_leaf_at_offset(root, range.start()).right_biased(),
|
||||
find_leaf_at_offset(root, range.end()).left_biased()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue