6056: Add dbgr postfix completion r=matklad a=lnicola

Expanding to `dbg!(&e)`.

Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
This commit is contained in:
bors[bot] 2020-09-24 14:14:01 +00:00 committed by GitHub
commit 5d137f21f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -185,6 +185,16 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
)
.add_to(acc);
postfix_snippet(
ctx,
cap,
&dot_receiver,
"dbgr",
"dbg!(&expr)",
&format!("dbg!(&{})", receiver_text),
)
.add_to(acc);
postfix_snippet(
ctx,
cap,
@ -263,6 +273,7 @@ fn main() {
sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr)
sn dbgr dbg!(&expr)
sn if if expr {}
sn match match expr {}
sn not !expr
@ -286,6 +297,7 @@ fn main() {
sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr)
sn dbgr dbg!(&expr)
sn match match expr {}
sn ref &expr
sn refm &mut expr