From e3b19da8c1e5ba10dffd7a5c381f101c815d46f8 Mon Sep 17 00:00:00 2001 From: Russell Mull Date: Mon, 21 Sep 2020 17:15:20 -0700 Subject: Add ok postfix completion --- crates/ide/src/completion/complete_postfix.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/ide/src/completion/complete_postfix.rs b/crates/ide/src/completion/complete_postfix.rs index 84c4e129d..c7c3f51a8 100644 --- a/crates/ide/src/completion/complete_postfix.rs +++ b/crates/ide/src/completion/complete_postfix.rs @@ -175,6 +175,16 @@ pub(super) 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, @@ -266,6 +276,7 @@ fn main() { sn if if expr {} sn match match expr {} sn not !expr + sn ok Ok(expr) sn ref &expr sn refm &mut expr sn while while expr {} @@ -287,6 +298,7 @@ fn main() { sn call function(expr) sn dbg dbg!(expr) sn match match expr {} + sn ok Ok(expr) sn ref &expr sn refm &mut expr "#]], -- cgit v1.2.3