mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 04:23:25 +00:00
Add completion to turn x.err into Err(x)
This commit is contained in:
parent
3fdf26a6fc
commit
5fc91058ff
1 changed files with 19 additions and 2 deletions
|
@ -180,8 +180,25 @@ pub(crate) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
|
|||
)
|
||||
.add_to(acc);
|
||||
|
||||
postfix_snippet(ctx, cap, &dot_receiver, "ok", "Ok(expr)", &format!("Ok({})", receiver_text))
|
||||
.add_to(acc);
|
||||
postfix_snippet(
|
||||
ctx,
|
||||
cap,
|
||||
&dot_receiver,
|
||||
"ok",
|
||||
"Ok(expr)",
|
||||
&format!("Ok({})", receiver_text)
|
||||
)
|
||||
.add_to(acc);
|
||||
|
||||
postfix_snippet(
|
||||
ctx,
|
||||
cap,
|
||||
&dot_receiver,
|
||||
"err",
|
||||
"Err(expr)",
|
||||
&format!("Err({})", receiver_text)
|
||||
)
|
||||
.add_to(acc);
|
||||
|
||||
postfix_snippet(
|
||||
ctx,
|
||||
|
|
Loading…
Reference in a new issue