From 9b1bc19d67ab6e4549f9bc0098949b842ce19fd0 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 15 Jan 2021 15:01:32 +0300 Subject: Add braces when completing ifs --- crates/completion/src/completions/keyword.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/completion/src') diff --git a/crates/completion/src/completions/keyword.rs b/crates/completion/src/completions/keyword.rs index 425a688ff..665214895 100644 --- a/crates/completion/src/completions/keyword.rs +++ b/crates/completion/src/completions/keyword.rs @@ -86,8 +86,8 @@ pub(crate) fn complete_expr_keyword(acc: &mut Completions, ctx: &CompletionConte add_keyword(ctx, acc, "match", "match $0 {}"); add_keyword(ctx, acc, "while", "while $0 {}"); add_keyword(ctx, acc, "loop", "loop {$0}"); - add_keyword(ctx, acc, "if", "if "); - add_keyword(ctx, acc, "if let", "if let "); + add_keyword(ctx, acc, "if", "if $0 {}"); + add_keyword(ctx, acc, "if let", "if let $1 = $0 {}"); } if ctx.if_is_prev || ctx.block_expr_parent { -- cgit v1.2.3