From e5fc42cbc114bcfa5a4fac48a16b70fce8d438ae Mon Sep 17 00:00:00 2001 From: Timo Freiberg Date: Thu, 26 Mar 2020 20:59:35 +0100 Subject: Add create_function assist --- docs/user/assists.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'docs') diff --git a/docs/user/assists.md b/docs/user/assists.md index 94b5ef85d..754131f6f 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. -- cgit v1.2.3