aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/references.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide_api/src/references.rs')
-rw-r--r--crates/ra_ide_api/src/references.rs34
1 files changed, 33 insertions, 1 deletions
diff --git a/crates/ra_ide_api/src/references.rs b/crates/ra_ide_api/src/references.rs
index 5c74d3e36..a75a0eb4f 100644
--- a/crates/ra_ide_api/src/references.rs
+++ b/crates/ra_ide_api/src/references.rs
@@ -356,7 +356,39 @@ mod tests {
356 ); 356 );
357 let new_name = "foo2"; 357 let new_name = "foo2";
358 let source_change = analysis.rename(position, new_name).unwrap(); 358 let source_change = analysis.rename(position, new_name).unwrap();
359 assert_debug_snapshot_matches!("rename_mod_in_dir", &source_change); 359 assert_debug_snapshot_matches!(&source_change,
360@r#"Some(
361 SourceChange {
362 label: "rename",
363 source_file_edits: [
364 SourceFileEdit {
365 file_id: FileId(
366 1,
367 ),
368 edit: TextEdit {
369 atoms: [
370 AtomTextEdit {
371 delete: [4; 7),
372 insert: "foo2",
373 },
374 ],
375 },
376 },
377 ],
378 file_system_edits: [
379 MoveFile {
380 src: FileId(
381 2,
382 ),
383 dst_source_root: SourceRootId(
384 0,
385 ),
386 dst_path: "foo2/mod.rs",
387 },
388 ],
389 cursor_position: None,
390 },
391)"#);
360 } 392 }
361 393
362 fn test_rename(text: &str, new_name: &str, expected: &str) { 394 fn test_rename(text: &str, new_name: &str, expected: &str) {