aboutsummaryrefslogtreecommitdiff
path: root/docs/user/features.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/user/features.md')
-rw-r--r--docs/user/features.md32
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:
335use algo:<|>:visitor::{Visitor, visit}; 335use algo:<|>:visitor::{Visitor, visit};
336//after: 336// after:
337use algo::{<|>visitor::{Visitor, visit}}; 337use algo::{<|>visitor::{Visitor, visit}};
338``` 338```
339 339
340- Flip binary expression
341
342```rust
343// before:
344fn foo() {
345 if 1 <<|> 2 {
346 println!("Who would have thought?");
347 }
348}
349// after:
350fn foo() {
351 if 2 ><|> 1 {
352 println!("Who would have thought?");
353 }
354}
355```
356
357- Add explicit type
358
359```rust
360// before:
361fn foo() {
362 let t<|> = (&2, Some(1));
363}
364// after:
365fn foo() {
366 let t<|>: (&i32, Option<i32>) = (&2, Some(1));
367}
368```
369
340### Magic Completions 370### Magic Completions
341 371
342In addition to usual reference completion, rust-analyzer provides some ✨magic✨ 372In addition to usual reference completion, rust-analyzer provides some ✨magic✨