mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-07 13:25:45 +00:00
Merge #6500
6500: Add some postfix snippet r=matklad a=pksunkara Nothing much to explain. Just a simple addition. I was recently doing some refactoring and this would have made it a bit more faster. Co-authored-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
This commit is contained in:
commit
a120884560
@ -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)
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user