Skip to content

Commit d00ca86

Browse files
bors[bot]matklad
andauthored
Merge #4868
4868: Fix if and while postfix completions r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2 parents c87c4a0 + 7dafe95 commit d00ca86

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

crates/ra_ide/src/completion/complete_postfix.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
9191
&dot_receiver,
9292
"if",
9393
"if expr {}",
94-
&format!("if {} {{$0}}", receiver_text),
94+
&format!("if {} {{\n $0\n}}", receiver_text),
9595
)
9696
.add_to(acc);
9797
postfix_snippet(
@@ -100,7 +100,7 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
100100
&dot_receiver,
101101
"while",
102102
"while expr {}",
103-
&format!("while {} {{\n$0\n}}", receiver_text),
103+
&format!("while {} {{\n $0\n}}", receiver_text),
104104
)
105105
.add_to(acc);
106106
}
@@ -283,7 +283,7 @@ mod tests {
283283
label: "if",
284284
source_range: 89..89,
285285
delete: 85..89,
286-
insert: "if bar {$0}",
286+
insert: "if bar {\n $0\n}",
287287
detail: "if expr {}",
288288
},
289289
CompletionItem {
@@ -318,7 +318,7 @@ mod tests {
318318
label: "while",
319319
source_range: 89..89,
320320
delete: 85..89,
321-
insert: "while bar {\n$0\n}",
321+
insert: "while bar {\n $0\n}",
322322
detail: "while expr {}",
323323
},
324324
]

0 commit comments

Comments
 (0)