aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/typing
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/typing')
-rw-r--r--crates/ra_ide/src/typing/on_enter.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/ra_ide/src/typing/on_enter.rs b/crates/ra_ide/src/typing/on_enter.rs
index 30c8c5572..78a40cc94 100644
--- a/crates/ra_ide/src/typing/on_enter.rs
+++ b/crates/ra_ide/src/typing/on_enter.rs
@@ -44,7 +44,7 @@ pub(crate) fn on_enter(db: &RootDatabase, position: FilePosition) -> Option<Sour
44 44
45 Some( 45 Some(
46 SourceChange::source_file_edit( 46 SourceChange::source_file_edit(
47 "on enter", 47 "On enter",
48 SourceFileEdit { edit, file_id: position.file_id }, 48 SourceFileEdit { edit, file_id: position.file_id },
49 ) 49 )
50 .with_cursor(FilePosition { offset: cursor_position, file_id: position.file_id }), 50 .with_cursor(FilePosition { offset: cursor_position, file_id: position.file_id }),
@@ -96,7 +96,8 @@ mod tests {
96 let result = analysis.on_enter(FilePosition { offset, file_id }).unwrap()?; 96 let result = analysis.on_enter(FilePosition { offset, file_id }).unwrap()?;
97 97
98 assert_eq!(result.source_file_edits.len(), 1); 98 assert_eq!(result.source_file_edits.len(), 1);
99 let actual = result.source_file_edits[0].edit.apply(&before); 99 let mut actual = before.to_string();
100 result.source_file_edits[0].edit.apply(&mut actual);
100 let actual = add_cursor(&actual, result.cursor_position.unwrap().offset); 101 let actual = add_cursor(&actual, result.cursor_position.unwrap().offset);
101 Some(actual) 102 Some(actual)
102 } 103 }