mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +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);
|
.add_to(acc);
|
||||||
|
|
||||||
postfix_snippet(ctx, cap, &dot_receiver, "ok", "Ok(expr)", &format!("Ok({})", receiver_text))
|
postfix_snippet(
|
||||||
.add_to(acc);
|
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(
|
postfix_snippet(
|
||||||
ctx,
|
ctx,
|
||||||
|
|
Loading…
Reference in a new issue