From ca3498bd841c19cf2081786e31cd8eec76480f20 Mon Sep 17 00:00:00 2001 From: Pavan Kumar Sunkara Date: Sun, 8 Nov 2020 19:43:25 +0100 Subject: [PATCH] Add some postfix snippet --- crates/completion/src/completions/postfix.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/completion/src/completions/postfix.rs b/crates/completion/src/completions/postfix.rs index 348f017bd70..7fbda7a6bd9 100644 --- a/crates/completion/src/completions/postfix.rs +++ b/crates/completion/src/completions/postfix.rs @@ -180,6 +180,16 @@ pub(crate) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { postfix_snippet(ctx, cap, &dot_receiver, "ok", "Ok(expr)", &format!("Ok({})", receiver_text)) .add_to(acc); + postfix_snippet( + ctx, + cap, + &dot_receiver, + "some", + "Some(expr)", + &format!("Some({})", receiver_text), + ) + .add_to(acc); + postfix_snippet( ctx, cap, @@ -291,6 +301,7 @@ fn main() { sn ok Ok(expr) sn ref &expr sn refm &mut expr + sn some Some(expr) sn while while expr {} "#]], ); @@ -314,6 +325,7 @@ fn main() { sn ok Ok(expr) sn ref &expr sn refm &mut expr + sn some Some(expr) "#]], ) }