aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/extend_selection.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-06-24 10:05:47 +0100
committerAleksey Kladov <[email protected]>2020-06-24 10:05:47 +0100
commite9cb818c2683e06153f013c3b8d03f7f2719eb02 (patch)
tree1eab8c2aaa60acc56d69e88d2eb888c1395fdbc2 /crates/ra_ide/src/extend_selection.rs
parent08e2149eab4495bd816a30b3caf586bef2cd9649 (diff)
Use fixtures more
Diffstat (limited to 'crates/ra_ide/src/extend_selection.rs')
-rw-r--r--crates/ra_ide/src/extend_selection.rs12
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..cb6b1a40d 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)]
317mod tests { 317mod tests {
318 use test_utils::extract_offset; 318 use crate::mock_analysis::single_file_with_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) = single_file_with_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();