diff options
Diffstat (limited to 'crates/ra_ide_api/src/references.rs')
-rw-r--r-- | crates/ra_ide_api/src/references.rs | 67 |
1 files changed, 33 insertions, 34 deletions
diff --git a/crates/ra_ide_api/src/references.rs b/crates/ra_ide_api/src/references.rs index 9e2601f83..a1415118d 100644 --- a/crates/ra_ide_api/src/references.rs +++ b/crates/ra_ide_api/src/references.rs | |||
@@ -389,40 +389,39 @@ mod tests { | |||
389 | let new_name = "foo2"; | 389 | let new_name = "foo2"; |
390 | let source_change = analysis.rename(position, new_name).unwrap(); | 390 | let source_change = analysis.rename(position, new_name).unwrap(); |
391 | assert_debug_snapshot_matches!(&source_change, | 391 | assert_debug_snapshot_matches!(&source_change, |
392 | @r###" | 392 | @r###"Some( |
393 | ⋮Some( | 393 | SourceChange { |
394 | ⋮ SourceChange { | 394 | label: "rename", |
395 | ⋮ label: "rename", | 395 | source_file_edits: [ |
396 | ⋮ source_file_edits: [ | 396 | SourceFileEdit { |
397 | ⋮ SourceFileEdit { | 397 | file_id: FileId( |
398 | ⋮ file_id: FileId( | 398 | 1, |
399 | ⋮ 1, | 399 | ), |
400 | ⋮ ), | 400 | edit: TextEdit { |
401 | ⋮ edit: TextEdit { | 401 | atoms: [ |
402 | ⋮ atoms: [ | 402 | AtomTextEdit { |
403 | ⋮ AtomTextEdit { | 403 | delete: [4; 7), |
404 | ⋮ delete: [4; 7), | 404 | insert: "foo2", |
405 | ⋮ insert: "foo2", | 405 | }, |
406 | ⋮ }, | 406 | ], |
407 | ⋮ ], | 407 | }, |
408 | ⋮ }, | 408 | }, |
409 | ⋮ }, | 409 | ], |
410 | ⋮ ], | 410 | file_system_edits: [ |
411 | ⋮ file_system_edits: [ | 411 | MoveFile { |
412 | ⋮ MoveFile { | 412 | src: FileId( |
413 | ⋮ src: FileId( | 413 | 2, |
414 | ⋮ 2, | 414 | ), |
415 | ⋮ ), | 415 | dst_source_root: SourceRootId( |
416 | ⋮ dst_source_root: SourceRootId( | 416 | 0, |
417 | ⋮ 0, | 417 | ), |
418 | ⋮ ), | 418 | dst_path: "foo2/mod.rs", |
419 | ⋮ dst_path: "foo2/mod.rs", | 419 | }, |
420 | ⋮ }, | 420 | ], |
421 | ⋮ ], | 421 | cursor_position: None, |
422 | ⋮ cursor_position: None, | 422 | }, |
423 | ⋮ }, | 423 | )"### |
424 | ⋮) | 424 | ); |
425 | "###); | ||
426 | } | 425 | } |
427 | 426 | ||
428 | fn test_rename(text: &str, new_name: &str, expected: &str) { | 427 | fn test_rename(text: &str, new_name: &str, expected: &str) { |