diff options
Diffstat (limited to 'crates/ra_editor/src/extend_selection.rs')
-rw-r--r-- | crates/ra_editor/src/extend_selection.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_editor/src/extend_selection.rs b/crates/ra_editor/src/extend_selection.rs index 9d8df25c3..8f11d5364 100644 --- a/crates/ra_editor/src/extend_selection.rs +++ b/crates/ra_editor/src/extend_selection.rs | |||
@@ -1,11 +1,11 @@ | |||
1 | use ra_syntax::{ | 1 | use ra_syntax::{ |
2 | algo::{find_covering_node, find_leaf_at_offset, LeafAtOffset}, | 2 | algo::{find_covering_node, find_leaf_at_offset, LeafAtOffset}, |
3 | Direction, File, | 3 | Direction, SourceFileNode, |
4 | SyntaxKind::*, | 4 | SyntaxKind::*, |
5 | SyntaxNodeRef, TextRange, TextUnit, | 5 | SyntaxNodeRef, TextRange, TextUnit, |
6 | }; | 6 | }; |
7 | 7 | ||
8 | pub fn extend_selection(file: &File, range: TextRange) -> Option<TextRange> { | 8 | pub fn extend_selection(file: &SourceFileNode, range: TextRange) -> Option<TextRange> { |
9 | let syntax = file.syntax(); | 9 | let syntax = file.syntax(); |
10 | extend(syntax.borrowed(), range) | 10 | extend(syntax.borrowed(), range) |
11 | } | 11 | } |
@@ -120,7 +120,7 @@ mod tests { | |||
120 | 120 | ||
121 | fn do_check(before: &str, afters: &[&str]) { | 121 | fn do_check(before: &str, afters: &[&str]) { |
122 | let (cursor, before) = extract_offset(before); | 122 | let (cursor, before) = extract_offset(before); |
123 | let file = File::parse(&before); | 123 | let file = SourceFileNode::parse(&before); |
124 | let mut range = TextRange::offset_len(cursor, 0.into()); | 124 | let mut range = TextRange::offset_len(cursor, 0.into()); |
125 | for &after in afters { | 125 | for &after in afters { |
126 | range = extend_selection(&file, range).unwrap(); | 126 | range = extend_selection(&file, range).unwrap(); |