auto-generate assists docs and tests

This commit is contained in:
Aleksey Kladov
2019-10-25 14:16:46 +03:00
parent 518f99e16b
commit 0dd35ff2b2
12 changed files with 269 additions and 52 deletions

24
docs/user/assists.md Normal file
View File

@@ -0,0 +1,24 @@
# Assists
## `convert_to_guarded_return`
Replace a large conditional with a guarded return.
```rust
// BEFORE
fn main() {
<|>if cond {
foo();
bar();
}
}
// AFTER
fn main() {
if !cond {
return;
}
foo();
bar();
}
```

View File

@@ -97,11 +97,13 @@ Start `cargo watch` for live error highlighting. Will prompt to install if it's
Stop `cargo watch`
### Code Actions (Assists)
### Assists (Code Actions)
These are triggered in a particular context via light bulb. We use custom code on
the VS Code side to be able to position cursor. `<|>` signifies cursor
See [assists.md](./assists.md)
- Add `#[derive]`
```rust