Skip to content

Commit ff28c79

Browse files
committed
Remove dead code for handling cursor positions
1 parent 4b495da commit ff28c79

File tree

8 files changed

+12
-388
lines changed

8 files changed

+12
-388
lines changed

crates/ra_assists/src/tests.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ use ra_db::{fixture::WithFixture, FileId, FileRange, SourceDatabaseExt};
77
use ra_ide_db::{symbol_index::SymbolsDatabase, RootDatabase};
88
use ra_syntax::TextRange;
99
use test_utils::{
10-
add_cursor, assert_eq_text, extract_offset, extract_range, extract_range_or_offset,
11-
RangeOrOffset,
10+
assert_eq_text, extract_offset, extract_range, extract_range_or_offset, RangeOrOffset,
1211
};
1312

1413
use crate::{handlers::Handler, Assist, AssistConfig, AssistContext, Assists};
@@ -103,12 +102,6 @@ fn check(handler: Handler, before: &str, expected: ExpectedResult) {
103102

104103
let mut actual = db.file_text(change.file_id).as_ref().to_owned();
105104
change.edit.apply(&mut actual);
106-
107-
if !source_change.is_snippet {
108-
if let Some(off) = source_change.cursor_position {
109-
actual = add_cursor(&actual, off.offset)
110-
}
111-
}
112105
assert_eq_text!(after, &actual);
113106
}
114107
(Some(assist), ExpectedResult::Target(target)) => {

crates/ra_ide/src/diagnostics.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,6 @@ mod tests {
628628
path: "foo.rs",
629629
},
630630
],
631-
cursor_position: None,
632631
is_snippet: false,
633632
},
634633
),
@@ -685,7 +684,6 @@ mod tests {
685684
},
686685
],
687686
file_system_edits: [],
688-
cursor_position: None,
689687
is_snippet: false,
690688
},
691689
),

crates/ra_ide/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ pub use ra_db::{
8787
pub use ra_ide_db::{
8888
change::{AnalysisChange, LibraryData},
8989
line_index::{LineCol, LineIndex},
90-
line_index_utils::translate_offset_with_edit,
9190
search::SearchScope,
9291
source_change::{FileSystemEdit, SourceChange, SourceFileEdit},
9392
symbol_index::Query,

crates/ra_ide/src/references/rename.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,6 @@ mod tests {
669669
dst_path: "bar/foo2.rs",
670670
},
671671
],
672-
cursor_position: None,
673672
is_snippet: false,
674673
},
675674
},
@@ -722,7 +721,6 @@ mod tests {
722721
dst_path: "foo2/mod.rs",
723722
},
724723
],
725-
cursor_position: None,
726724
is_snippet: false,
727725
},
728726
},
@@ -819,7 +817,6 @@ mod tests {
819817
dst_path: "bar/foo2.rs",
820818
},
821819
],
822-
cursor_position: None,
823820
is_snippet: false,
824821
},
825822
},

crates/ra_ide_db/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
//! It is mainly a `HirDatabase` for semantic analysis, plus a `SymbolsDatabase`, for fuzzy search.
44
55
pub mod line_index;
6-
pub mod line_index_utils;
76
pub mod symbol_index;
87
pub mod change;
98
pub mod defs;

crates/ra_ide_db/src/line_index_utils.rs

Lines changed: 0 additions & 302 deletions
This file was deleted.

0 commit comments

Comments
 (0)