diff options
author | Aleksey Kladov <[email protected]> | 2018-10-02 16:02:57 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-10-02 16:02:57 +0100 |
commit | d323c81d5cc6a198239285abcede2166181d8f39 (patch) | |
tree | 02c64a01b14d893df439a9e90797db6d58c5a54d /crates/ra_editor/src/extend_selection.rs | |
parent | dccaa5e45e9baaa2d286353a7499a89af1669e42 (diff) |
make ancestors and descendants inherent
Diffstat (limited to 'crates/ra_editor/src/extend_selection.rs')
-rw-r--r-- | crates/ra_editor/src/extend_selection.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_editor/src/extend_selection.rs b/crates/ra_editor/src/extend_selection.rs index dc914a26a..2f8a04b2b 100644 --- a/crates/ra_editor/src/extend_selection.rs +++ b/crates/ra_editor/src/extend_selection.rs | |||
@@ -1,7 +1,7 @@ | |||
1 | use ra_syntax::{ | 1 | use ra_syntax::{ |
2 | File, TextRange, SyntaxNodeRef, TextUnit, | 2 | File, TextRange, SyntaxNodeRef, TextUnit, |
3 | SyntaxKind::*, | 3 | SyntaxKind::*, |
4 | algo::{find_leaf_at_offset, LeafAtOffset, find_covering_node, ancestors, Direction, siblings}, | 4 | algo::{find_leaf_at_offset, LeafAtOffset, find_covering_node, Direction, siblings}, |
5 | }; | 5 | }; |
6 | 6 | ||
7 | pub fn extend_selection(file: &File, range: TextRange) -> Option<TextRange> { | 7 | pub fn extend_selection(file: &File, range: TextRange) -> Option<TextRange> { |
@@ -30,7 +30,7 @@ pub(crate) fn extend(root: SyntaxNodeRef, range: TextRange) -> Option<TextRange> | |||
30 | } | 30 | } |
31 | } | 31 | } |
32 | 32 | ||
33 | match ancestors(node).skip_while(|n| n.range() == range).next() { | 33 | match node.ancestors().skip_while(|n| n.range() == range).next() { |
34 | None => None, | 34 | None => None, |
35 | Some(parent) => Some(parent.range()), | 35 | Some(parent) => Some(parent.range()), |
36 | } | 36 | } |