diff options
author | Kevin DeLorey <[email protected]> | 2020-02-09 16:25:47 +0000 |
---|---|---|
committer | Kevin DeLorey <[email protected]> | 2020-02-09 16:37:43 +0000 |
commit | a957c473fdb79880c39b73dc9e0c923093cf16ac (patch) | |
tree | f998b548f530ce604651e0e6af314ed2ec74b3b5 /docs/user/assists.md | |
parent | 22caf982b99c54058e2e9200aeea0e61cada284a (diff) | |
parent | 1b9b13b4b4a75b5531c3f046ce6bf72d681f2732 (diff) |
Merge branch 'master' into kdelorey/complete-trait-impl
Diffstat (limited to 'docs/user/assists.md')
-rw-r--r-- | docs/user/assists.md | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/docs/user/assists.md b/docs/user/assists.md index ecf206f71..f737a2fa4 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md | |||
@@ -154,20 +154,6 @@ impl Trait<u32> for () { | |||
154 | } | 154 | } |
155 | ``` | 155 | ``` |
156 | 156 | ||
157 | ## `add_import` | ||
158 | |||
159 | Adds a use statement for a given fully-qualified path. | ||
160 | |||
161 | ```rust | ||
162 | // BEFORE | ||
163 | fn process(map: std::collections::┃HashMap<String, String>) {} | ||
164 | |||
165 | // AFTER | ||
166 | use std::collections::HashMap; | ||
167 | |||
168 | fn process(map: HashMap<String, String>) {} | ||
169 | ``` | ||
170 | |||
171 | ## `add_new` | 157 | ## `add_new` |
172 | 158 | ||
173 | Adds a new inherent impl for a type. | 159 | Adds a new inherent impl for a type. |
@@ -209,6 +195,24 @@ fn main() { | |||
209 | } | 195 | } |
210 | ``` | 196 | ``` |
211 | 197 | ||
198 | ## `auto_import` | ||
199 | |||
200 | If the name is unresolved, provides all possible imports for it. | ||
201 | |||
202 | ```rust | ||
203 | // BEFORE | ||
204 | fn main() { | ||
205 | let map = HashMap┃::new(); | ||
206 | } | ||
207 | |||
208 | // AFTER | ||
209 | use std::collections::HashMap; | ||
210 | |||
211 | fn main() { | ||
212 | let map = HashMap::new(); | ||
213 | } | ||
214 | ``` | ||
215 | |||
212 | ## `change_visibility` | 216 | ## `change_visibility` |
213 | 217 | ||
214 | Adds or changes existing visibility specifier. | 218 | Adds or changes existing visibility specifier. |
@@ -550,6 +554,20 @@ fn handle(action: Action) { | |||
550 | } | 554 | } |
551 | ``` | 555 | ``` |
552 | 556 | ||
557 | ## `replace_qualified_name_with_use` | ||
558 | |||
559 | Adds a use statement for a given fully-qualified name. | ||
560 | |||
561 | ```rust | ||
562 | // BEFORE | ||
563 | fn process(map: std::collections::┃HashMap<String, String>) {} | ||
564 | |||
565 | // AFTER | ||
566 | use std::collections::HashMap; | ||
567 | |||
568 | fn process(map: HashMap<String, String>) {} | ||
569 | ``` | ||
570 | |||
553 | ## `split_import` | 571 | ## `split_import` |
554 | 572 | ||
555 | Wraps the tail of import into braces. | 573 | Wraps the tail of import into braces. |