aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src')
-rw-r--r--crates/ra_ide_api/src/references.rs34
-rw-r--r--crates/ra_ide_api/src/snapshots/tests__rename_mod.snap38
2 files changed, 33 insertions, 39 deletions
diff --git a/crates/ra_ide_api/src/references.rs b/crates/ra_ide_api/src/references.rs
index 9b9f75af0..9e2601f83 100644
--- a/crates/ra_ide_api/src/references.rs
+++ b/crates/ra_ide_api/src/references.rs
@@ -341,7 +341,39 @@ mod tests {
341 ); 341 );
342 let new_name = "foo2"; 342 let new_name = "foo2";
343 let source_change = analysis.rename(position, new_name).unwrap(); 343 let source_change = analysis.rename(position, new_name).unwrap();
344 assert_debug_snapshot_matches!("rename_mod", &source_change); 344 assert_debug_snapshot_matches!(&source_change,
345@r#"Some(
346 SourceChange {
347 label: "rename",
348 source_file_edits: [
349 SourceFileEdit {
350 file_id: FileId(
351 2,
352 ),
353 edit: TextEdit {
354 atoms: [
355 AtomTextEdit {
356 delete: [4; 7),
357 insert: "foo2",
358 },
359 ],
360 },
361 },
362 ],
363 file_system_edits: [
364 MoveFile {
365 src: FileId(
366 3,
367 ),
368 dst_source_root: SourceRootId(
369 0,
370 ),
371 dst_path: "bar/foo2.rs",
372 },
373 ],
374 cursor_position: None,
375 },
376)"#);
345 } 377 }
346 378
347 #[test] 379 #[test]
diff --git a/crates/ra_ide_api/src/snapshots/tests__rename_mod.snap b/crates/ra_ide_api/src/snapshots/tests__rename_mod.snap
deleted file mode 100644
index 431de5c55..000000000
--- a/crates/ra_ide_api/src/snapshots/tests__rename_mod.snap
+++ /dev/null
@@ -1,38 +0,0 @@
1---
2created: "2019-05-23T22:23:35.215905447Z"
3creator: [email protected]
4source: crates/ra_ide_api/src/references.rs
5expression: "&source_change"
6---
7Some(
8 SourceChange {
9 label: "rename",
10 source_file_edits: [
11 SourceFileEdit {
12 file_id: FileId(
13 2,
14 ),
15 edit: TextEdit {
16 atoms: [
17 AtomTextEdit {
18 delete: [4; 7),
19 insert: "foo2",
20 },
21 ],
22 },
23 },
24 ],
25 file_system_edits: [
26 MoveFile {
27 src: FileId(
28 3,
29 ),
30 dst_source_root: SourceRootId(
31 0,
32 ),
33 dst_path: "bar/foo2.rs",
34 },
35 ],
36 cursor_position: None,
37 },
38)