aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-11-09 09:55:46 +0000
committerGitHub <[email protected]>2020-11-09 09:55:46 +0000
commita12088456072459c7df2d9d8f077a69ab518710a (patch)
tree8355610796ccf7bf4700f87e7c6fadceb5a93c4c /crates
parent945900bdbf5423fdfb8542901dfb813c2ec32e09 (diff)
parentca3498bd841c19cf2081786e31cd8eec76480f20 (diff)
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 <[email protected]>
Diffstat (limited to 'crates')
-rw-r--r--crates/completion/src/completions/postfix.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/crates/completion/src/completions/postfix.rs b/crates/completion/src/completions/postfix.rs
index 348f017bd..7fbda7a6b 100644
--- a/crates/completion/src/completions/postfix.rs
+++ b/crates/completion/src/completions/postfix.rs
@@ -184,6 +184,16 @@ pub(crate) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) {
184 ctx, 184 ctx,
185 cap, 185 cap,
186 &dot_receiver, 186 &dot_receiver,
187 "some",
188 "Some(expr)",
189 &format!("Some({})", receiver_text),
190 )
191 .add_to(acc);
192
193 postfix_snippet(
194 ctx,
195 cap,
196 &dot_receiver,
187 "dbg", 197 "dbg",
188 "dbg!(expr)", 198 "dbg!(expr)",
189 &format!("dbg!({})", receiver_text), 199 &format!("dbg!({})", receiver_text),
@@ -291,6 +301,7 @@ fn main() {
291 sn ok Ok(expr) 301 sn ok Ok(expr)
292 sn ref &expr 302 sn ref &expr
293 sn refm &mut expr 303 sn refm &mut expr
304 sn some Some(expr)
294 sn while while expr {} 305 sn while while expr {}
295 "#]], 306 "#]],
296 ); 307 );
@@ -314,6 +325,7 @@ fn main() {
314 sn ok Ok(expr) 325 sn ok Ok(expr)
315 sn ref &expr 326 sn ref &expr
316 sn refm &mut expr 327 sn refm &mut expr
328 sn some Some(expr)
317 "#]], 329 "#]],
318 ) 330 )
319 } 331 }