aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMarco Groppo <[email protected]>2019-04-09 20:12:54 +0100
committerMarco Groppo <[email protected]>2019-04-09 20:12:54 +0100
commitc5f8f3b1f423781e09bb5f63e33d772ee59fab77 (patch)
treec9cab7d79be607f2c741a91ee032f3a3a964f31b /docs
parenta4ba3841b4cbf2dd3536183464281dfdd2a22409 (diff)
Stylistic changes. Updated features.md with the new assists.
Diffstat (limited to 'docs')
-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✨