aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_editor/src/extend_selection.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-11-07 15:32:33 +0000
committerAleksey Kladov <[email protected]>2018-11-07 15:42:36 +0000
commitf8b36bbc3b968754b71844d942286e81415627b8 (patch)
tree72be8cc4bac951b00746291e4b357b86def7d4c7 /crates/ra_editor/src/extend_selection.rs
parent2119fe214303325e86174b139d7ad8193b2ce251 (diff)
Rename File -> SourceFileNode
Diffstat (limited to 'crates/ra_editor/src/extend_selection.rs')
-rw-r--r--crates/ra_editor/src/extend_selection.rs6
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 @@
1use ra_syntax::{ 1use 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
8pub fn extend_selection(file: &File, range: TextRange) -> Option<TextRange> { 8pub 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();