diff options
Diffstat (limited to 'crates/ide/src/completion')
-rw-r--r-- | crates/ide/src/completion/complete_postfix.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/crates/ide/src/completion/complete_postfix.rs b/crates/ide/src/completion/complete_postfix.rs index 84c4e129d..26a5af5b9 100644 --- a/crates/ide/src/completion/complete_postfix.rs +++ b/crates/ide/src/completion/complete_postfix.rs | |||
@@ -175,6 +175,9 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { | |||
175 | ) | 175 | ) |
176 | .add_to(acc); | 176 | .add_to(acc); |
177 | 177 | ||
178 | postfix_snippet(ctx, cap, &dot_receiver, "ok", "Ok(expr)", &format!("Ok({})", receiver_text)) | ||
179 | .add_to(acc); | ||
180 | |||
178 | postfix_snippet( | 181 | postfix_snippet( |
179 | ctx, | 182 | ctx, |
180 | cap, | 183 | cap, |
@@ -189,6 +192,16 @@ pub(super) fn complete_postfix(acc: &mut Completions, ctx: &CompletionContext) { | |||
189 | ctx, | 192 | ctx, |
190 | cap, | 193 | cap, |
191 | &dot_receiver, | 194 | &dot_receiver, |
195 | "dbgr", | ||
196 | "dbg!(&expr)", | ||
197 | &format!("dbg!(&{})", receiver_text), | ||
198 | ) | ||
199 | .add_to(acc); | ||
200 | |||
201 | postfix_snippet( | ||
202 | ctx, | ||
203 | cap, | ||
204 | &dot_receiver, | ||
192 | "call", | 205 | "call", |
193 | "function(expr)", | 206 | "function(expr)", |
194 | &format!("${{1}}({})", receiver_text), | 207 | &format!("${{1}}({})", receiver_text), |
@@ -263,9 +276,11 @@ fn main() { | |||
263 | sn box Box::new(expr) | 276 | sn box Box::new(expr) |
264 | sn call function(expr) | 277 | sn call function(expr) |
265 | sn dbg dbg!(expr) | 278 | sn dbg dbg!(expr) |
279 | sn dbgr dbg!(&expr) | ||
266 | sn if if expr {} | 280 | sn if if expr {} |
267 | sn match match expr {} | 281 | sn match match expr {} |
268 | sn not !expr | 282 | sn not !expr |
283 | sn ok Ok(expr) | ||
269 | sn ref &expr | 284 | sn ref &expr |
270 | sn refm &mut expr | 285 | sn refm &mut expr |
271 | sn while while expr {} | 286 | sn while while expr {} |
@@ -286,7 +301,9 @@ fn main() { | |||
286 | sn box Box::new(expr) | 301 | sn box Box::new(expr) |
287 | sn call function(expr) | 302 | sn call function(expr) |
288 | sn dbg dbg!(expr) | 303 | sn dbg dbg!(expr) |
304 | sn dbgr dbg!(&expr) | ||
289 | sn match match expr {} | 305 | sn match match expr {} |
306 | sn ok Ok(expr) | ||
290 | sn ref &expr | 307 | sn ref &expr |
291 | sn refm &mut expr | 308 | sn refm &mut expr |
292 | "#]], | 309 | "#]], |