From 7dafe951d468216a9d54dc3af3da6dcfce881e79 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 13 Jun 2020 14:06:13 +0200 Subject: Fix if and while postfix completions --- crates/ra_ide/src/completion/complete_postfix.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/ra_ide/src/completion') diff --git a/crates/ra_ide/src/completion/complete_postfix.rs b/crates/ra_ide/src/completion/complete_postfix.rs index 59b58bf98..b878aeb0a 100644 --- a/crates/ra_ide/src/completion/complete_postfix.rs +++ b/crates/ra_ide/src/completion/complete_postfix.rs @@ -91,7 +91,7 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { &dot_receiver, "if", "if expr {}", - &format!("if {} {{$0}}", receiver_text), + &format!("if {} {{\n $0\n}}", receiver_text), ) .add_to(acc); postfix_snippet( @@ -100,7 +100,7 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { &dot_receiver, "while", "while expr {}", - &format!("while {} {{\n$0\n}}", receiver_text), + &format!("while {} {{\n $0\n}}", receiver_text), ) .add_to(acc); } @@ -283,7 +283,7 @@ mod tests { label: "if", source_range: 89..89, delete: 85..89, - insert: "if bar {$0}", + insert: "if bar {\n $0\n}", detail: "if expr {}", }, CompletionItem { @@ -318,7 +318,7 @@ mod tests { label: "while", source_range: 89..89, delete: 85..89, - insert: "while bar {\n$0\n}", + insert: "while bar {\n $0\n}", detail: "while expr {}", }, ] -- cgit v1.2.3