diff options
Diffstat (limited to 'crates/ra_ide_api/src/typing.rs')
-rw-r--r-- | crates/ra_ide_api/src/typing.rs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/crates/ra_ide_api/src/typing.rs b/crates/ra_ide_api/src/typing.rs index 424084468..aa9971450 100644 --- a/crates/ra_ide_api/src/typing.rs +++ b/crates/ra_ide_api/src/typing.rs | |||
@@ -112,16 +112,14 @@ pub(crate) fn on_dot_typed(db: &RootDatabase, position: FilePosition) -> Option< | |||
112 | TextRange::from_to(position.offset - current_indent_len, position.offset), | 112 | TextRange::from_to(position.offset - current_indent_len, position.offset), |
113 | target_indent.into(), | 113 | target_indent.into(), |
114 | ); | 114 | ); |
115 | let res = SourceChange { | 115 | |
116 | label: "reindent dot".to_string(), | 116 | let res = SourceChange::source_file_edit_from("reindent dot", position.file_id, edit.finish()) |
117 | source_file_edits: vec![SourceFileEdit { edit: edit.finish(), file_id: position.file_id }], | 117 | .with_cursor(FilePosition { |
118 | file_system_edits: vec![], | ||
119 | cursor_position: Some(FilePosition { | ||
120 | offset: position.offset + target_indent_len - current_indent_len | 118 | offset: position.offset + target_indent_len - current_indent_len |
121 | + TextUnit::of_char('.'), | 119 | + TextUnit::of_char('.'), |
122 | file_id: position.file_id, | 120 | file_id: position.file_id, |
123 | }), | 121 | }); |
124 | }; | 122 | |
125 | Some(res) | 123 | Some(res) |
126 | } | 124 | } |
127 | 125 | ||