diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-06-13 13:12:08 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-06-13 13:12:08 +0100 |
commit | d00ca86da41da2df8381131f35733cbc129ac7fd (patch) | |
tree | 174ae08838e4080f67fd2545a531288ba2e9409f /crates/ra_ide/src/completion | |
parent | c87c4a0a40c79e90272d4df62c7e2dc12b6b2c3e (diff) | |
parent | 7dafe951d468216a9d54dc3af3da6dcfce881e79 (diff) |
Merge #4868
4868: Fix if and while postfix completions r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide/src/completion')
-rw-r--r-- | crates/ra_ide/src/completion/complete_postfix.rs | 8 |
1 files changed, 4 insertions, 4 deletions
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) { | |||
91 | &dot_receiver, | 91 | &dot_receiver, |
92 | "if", | 92 | "if", |
93 | "if expr {}", | 93 | "if expr {}", |
94 | &format!("if {} {{$0}}", receiver_text), | 94 | &format!("if {} {{\n $0\n}}", receiver_text), |
95 | ) | 95 | ) |
96 | .add_to(acc); | 96 | .add_to(acc); |
97 | postfix_snippet( | 97 | postfix_snippet( |
@@ -100,7 +100,7 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { | |||
100 | &dot_receiver, | 100 | &dot_receiver, |
101 | "while", | 101 | "while", |
102 | "while expr {}", | 102 | "while expr {}", |
103 | &format!("while {} {{\n$0\n}}", receiver_text), | 103 | &format!("while {} {{\n $0\n}}", receiver_text), |
104 | ) | 104 | ) |
105 | .add_to(acc); | 105 | .add_to(acc); |
106 | } | 106 | } |
@@ -283,7 +283,7 @@ mod tests { | |||
283 | label: "if", | 283 | label: "if", |
284 | source_range: 89..89, | 284 | source_range: 89..89, |
285 | delete: 85..89, | 285 | delete: 85..89, |
286 | insert: "if bar {$0}", | 286 | insert: "if bar {\n $0\n}", |
287 | detail: "if expr {}", | 287 | detail: "if expr {}", |
288 | }, | 288 | }, |
289 | CompletionItem { | 289 | CompletionItem { |
@@ -318,7 +318,7 @@ mod tests { | |||
318 | label: "while", | 318 | label: "while", |
319 | source_range: 89..89, | 319 | source_range: 89..89, |
320 | delete: 85..89, | 320 | delete: 85..89, |
321 | insert: "while bar {\n$0\n}", | 321 | insert: "while bar {\n $0\n}", |
322 | detail: "while expr {}", | 322 | detail: "while expr {}", |
323 | }, | 323 | }, |
324 | ] | 324 | ] |