diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/user/features.md | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/docs/user/features.md b/docs/user/features.md index 3ac99eef1..09a7f5a43 100644 --- a/docs/user/features.md +++ b/docs/user/features.md | |||
@@ -333,10 +333,40 @@ impl VariantData { | |||
333 | ```rust | 333 | ```rust |
334 | // before: | 334 | // before: |
335 | use algo:<|>:visitor::{Visitor, visit}; | 335 | use algo:<|>:visitor::{Visitor, visit}; |
336 | //after: | 336 | // after: |
337 | use algo::{<|>visitor::{Visitor, visit}}; | 337 | use algo::{<|>visitor::{Visitor, visit}}; |
338 | ``` | 338 | ``` |
339 | 339 | ||
340 | - Flip binary expression | ||
341 | |||
342 | ```rust | ||
343 | // before: | ||
344 | fn foo() { | ||
345 | if 1 <<|> 2 { | ||
346 | println!("Who would have thought?"); | ||
347 | } | ||
348 | } | ||
349 | // after: | ||
350 | fn foo() { | ||
351 | if 2 ><|> 1 { | ||
352 | println!("Who would have thought?"); | ||
353 | } | ||
354 | } | ||
355 | ``` | ||
356 | |||
357 | - Add explicit type | ||
358 | |||
359 | ```rust | ||
360 | // before: | ||
361 | fn foo() { | ||
362 | let t<|> = (&2, Some(1)); | ||
363 | } | ||
364 | // after: | ||
365 | fn foo() { | ||
366 | let t<|>: (&i32, Option<i32>) = (&2, Some(1)); | ||
367 | } | ||
368 | ``` | ||
369 | |||
340 | ### Magic Completions | 370 | ### Magic Completions |
341 | 371 | ||
342 | In addition to usual reference completion, rust-analyzer provides some ✨magic✨ | 372 | In addition to usual reference completion, rust-analyzer provides some ✨magic✨ |