diff options
| author | Timo Freiberg <timo.freiberg@gmail.com> | 2020-03-26 20:59:35 +0100 |
|---|---|---|
| committer | Timo Freiberg <timo.freiberg@gmail.com> | 2020-04-01 23:06:14 +0200 |
| commit | e5fc42cbc114bcfa5a4fac48a16b70fce8d438ae (patch) | |
| tree | 1fac06039cf04636a259fe21d98a8a8875e2c096 /docs | |
| parent | f696df379a5dd450b3d89a8c690de5f8d78f6be2 (diff) | |
| download | rust-e5fc42cbc114bcfa5a4fac48a16b70fce8d438ae.tar.gz rust-e5fc42cbc114bcfa5a4fac48a16b70fce8d438ae.zip | |
Add create_function assist
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/user/assists.md | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/docs/user/assists.md b/docs/user/assists.md index 94b5ef85d6d..754131f6fec 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md @@ -56,6 +56,32 @@ fn main() { } ``` +## `add_function` + +Adds a stub function with a signature matching the function under the cursor. + +```rust +// BEFORE +struct Baz; +fn baz() -> Baz { Baz } +fn foo() { + bar┃("", baz()); +} + + +// AFTER +struct Baz; +fn baz() -> Baz { Baz } +fn foo() { + bar("", baz()); +} + +fn bar(arg: &str, baz: Baz) { + unimplemented!() +} + +``` + ## `add_hash` Adds a hash to a raw string literal. |
