Skip to content

Commit 5fc9105

Browse files
Add completion to turn x.err into Err(x)
1 parent 3fdf26a commit 5fc9105

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

crates/ide_completion/src/completions/postfix.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,25 @@ pub(crate) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
180180
)
181181
.add_to(acc);
182182

183-
postfix_snippet(ctx, cap, &dot_receiver, "ok", "Ok(expr)", &format!("Ok({})", receiver_text))
184-
.add_to(acc);
183+
postfix_snippet(
184+
ctx,
185+
cap,
186+
&dot_receiver,
187+
"ok",
188+
"Ok(expr)",
189+
&format!("Ok({})", receiver_text)
190+
)
191+
.add_to(acc);
192+
193+
postfix_snippet(
194+
ctx,
195+
cap,
196+
&dot_receiver,
197+
"err",
198+
"Err(expr)",
199+
&format!("Err({})", receiver_text)
200+
)
201+
.add_to(acc);
185202

186203
postfix_snippet(
187204
ctx,

0 commit comments

Comments
 (0)