Add braces when completing ifs

This commit is contained in:
Aleksey Kladov 2021-01-15 15:01:32 +03:00
parent 054e206152
commit 9b1bc19d67

View file

@ -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 {