aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-09-24 15:14:01 +0100
committerGitHub <[email protected]>2020-09-24 15:14:01 +0100
commit5d137f21f298c079b761bdae8284e1cd88fafb88 (patch)
treebebfa83c893076c6240855c6eebe17a6edcac4a8
parentde4fb138063c859f29b5a4cf6d382d94e38bb48c (diff)
parenteb0e710779eac63cc855ee054c73f87a8021154f (diff)
Merge #6056
6056: Add dbgr postfix completion r=matklad a=lnicola Expanding to `dbg!(&e)`. Co-authored-by: LaurenČ›iu Nicola <[email protected]>
-rw-r--r--crates/ide/src/completion/complete_postfix.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/ide/src/completion/complete_postfix.rs b/crates/ide/src/completion/complete_postfix.rs
index 84c4e129d..29d38661b 100644
--- a/crates/ide/src/completion/complete_postfix.rs
+++ b/crates/ide/src/completion/complete_postfix.rs
@@ -189,6 +189,16 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
189 ctx, 189 ctx,
190 cap, 190 cap,
191 &dot_receiver, 191 &dot_receiver,
192 "dbgr",
193 "dbg!(&expr)",
194 &format!("dbg!(&{})", receiver_text),
195 )
196 .add_to(acc);
197
198 postfix_snippet(
199 ctx,
200 cap,
201 &dot_receiver,
192 "call", 202 "call",
193 "function(expr)", 203 "function(expr)",
194 &format!("${{1}}({})", receiver_text), 204 &format!("${{1}}({})", receiver_text),
@@ -263,6 +273,7 @@ fn main() {
263 sn box Box::new(expr) 273 sn box Box::new(expr)
264 sn call function(expr) 274 sn call function(expr)
265 sn dbg dbg!(expr) 275 sn dbg dbg!(expr)
276 sn dbgr dbg!(&expr)
266 sn if if expr {} 277 sn if if expr {}
267 sn match match expr {} 278 sn match match expr {}
268 sn not !expr 279 sn not !expr
@@ -286,6 +297,7 @@ fn main() {
286 sn box Box::new(expr) 297 sn box Box::new(expr)
287 sn call function(expr) 298 sn call function(expr)
288 sn dbg dbg!(expr) 299 sn dbg dbg!(expr)
300 sn dbgr dbg!(&expr)
289 sn match match expr {} 301 sn match match expr {}
290 sn ref &expr 302 sn ref &expr
291 sn refm &mut expr 303 sn refm &mut expr