diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-22 17:09:37 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-22 17:09:37 +0100 |
commit | a95bb1355dd5fb95f6d66e6cd6b14b6ae8051f77 (patch) | |
tree | d4b33d1360afd4dbcbd479f0691bed7c98de2895 /crates/ra_ide/src/typing | |
parent | 2a36a2a3cc016de61a5df3165037ed689f36c423 (diff) | |
parent | 2c04aad2d2a52ce52d6ea6452faf8d1788f0c83f (diff) |
Merge #4571
4571: KISS SourceChange r=matklad a=matklad
The idea behind requiring the label is a noble one, but we are not
really using it consistently anyway, and it should be easy to retrofit
later, should we need it.
bors r+
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/typing')
-rw-r--r-- | crates/ra_ide/src/typing/on_enter.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/crates/ra_ide/src/typing/on_enter.rs b/crates/ra_ide/src/typing/on_enter.rs index 85be14ad3..e7d64b4f6 100644 --- a/crates/ra_ide/src/typing/on_enter.rs +++ b/crates/ra_ide/src/typing/on_enter.rs | |||
@@ -41,10 +41,7 @@ pub(crate) fn on_enter(db: &RootDatabase, position: FilePosition) -> Option<Sour | |||
41 | let inserted = format!("\n{}{} $0", indent, prefix); | 41 | let inserted = format!("\n{}{} $0", indent, prefix); |
42 | let edit = TextEdit::insert(position.offset, inserted); | 42 | let edit = TextEdit::insert(position.offset, inserted); |
43 | 43 | ||
44 | let mut res = SourceChange::source_file_edit( | 44 | let mut res = SourceChange::from(SourceFileEdit { edit, file_id: position.file_id }); |
45 | "On enter", | ||
46 | SourceFileEdit { edit, file_id: position.file_id }, | ||
47 | ); | ||
48 | res.is_snippet = true; | 45 | res.is_snippet = true; |
49 | Some(res) | 46 | Some(res) |
50 | } | 47 | } |