aboutsummaryrefslogtreecommitdiff
path: root/docs/user/assists.md
diff options
context:
space:
mode:
authorTimo Freiberg <[email protected]>2020-03-26 19:59:35 +0000
committerTimo Freiberg <[email protected]>2020-04-01 22:06:14 +0100
commite5fc42cbc114bcfa5a4fac48a16b70fce8d438ae (patch)
tree1fac06039cf04636a259fe21d98a8a8875e2c096 /docs/user/assists.md
parentf696df379a5dd450b3d89a8c690de5f8d78f6be2 (diff)
Add create_function assist
Diffstat (limited to 'docs/user/assists.md')
-rw-r--r--docs/user/assists.md26
1 files changed, 26 insertions, 0 deletions
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() {
56} 56}
57``` 57```
58 58
59## `add_function`
60
61Adds a stub function with a signature matching the function under the cursor.
62
63```rust
64// BEFORE
65struct Baz;
66fn baz() -> Baz { Baz }
67fn foo() {
68 bar┃("", baz());
69}
70
71
72// AFTER
73struct Baz;
74fn baz() -> Baz { Baz }
75fn foo() {
76 bar("", baz());
77}
78
79fn bar(arg: &str, baz: Baz) {
80 unimplemented!()
81}
82
83```
84
59## `add_hash` 85## `add_hash`
60 86
61Adds a hash to a raw string literal. 87Adds a hash to a raw string literal.