diff options
Diffstat (limited to 'crates/ra_ide/src/extend_selection.rs')
-rw-r--r-- | crates/ra_ide/src/extend_selection.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/crates/ra_ide/src/extend_selection.rs b/crates/ra_ide/src/extend_selection.rs index a4bc93cdb..8a6b3ea99 100644 --- a/crates/ra_ide/src/extend_selection.rs +++ b/crates/ra_ide/src/extend_selection.rs | |||
@@ -315,17 +315,15 @@ fn adj_comments(comment: &ast::Comment, dir: Direction) -> ast::Comment { | |||
315 | 315 | ||
316 | #[cfg(test)] | 316 | #[cfg(test)] |
317 | mod tests { | 317 | mod tests { |
318 | use test_utils::extract_offset; | 318 | use crate::mock_analysis::analysis_and_position; |
319 | |||
320 | use crate::mock_analysis::single_file; | ||
321 | 319 | ||
322 | use super::*; | 320 | use super::*; |
323 | 321 | ||
324 | fn do_check(before: &str, afters: &[&str]) { | 322 | fn do_check(before: &str, afters: &[&str]) { |
325 | let (cursor, before) = extract_offset(before); | 323 | let (analysis, position) = analysis_and_position(&before); |
326 | let (analysis, file_id) = single_file(&before); | 324 | let before = analysis.file_text(position.file_id).unwrap(); |
327 | let range = TextRange::empty(cursor); | 325 | let range = TextRange::empty(position.offset); |
328 | let mut frange = FileRange { file_id, range }; | 326 | let mut frange = FileRange { file_id: position.file_id, range }; |
329 | 327 | ||
330 | for &after in afters { | 328 | for &after in afters { |
331 | frange.range = analysis.extend_selection(frange).unwrap(); | 329 | frange.range = analysis.extend_selection(frange).unwrap(); |