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,7 +180,24 @@ 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(
|
||||||
|
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);
|
.add_to(acc);
|
||||||
|
|
||||||
postfix_snippet(
|
postfix_snippet(
|
||||||
|
|
Loading…
Reference in a new issue