diff options
Diffstat (limited to 'docs/user')
-rw-r--r-- | docs/user/assists.md | 26 | ||||
-rw-r--r-- | docs/user/features.md | 20 |
2 files changed, 29 insertions, 17 deletions
diff --git a/docs/user/assists.md b/docs/user/assists.md index e4d08a7dc..303353e74 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md | |||
@@ -136,6 +136,20 @@ impl T for () { | |||
136 | } | 136 | } |
137 | ``` | 137 | ``` |
138 | 138 | ||
139 | ## `add_import` | ||
140 | |||
141 | Adds a use statement for a given fully-qualified path. | ||
142 | |||
143 | ```rust | ||
144 | // BEFORE | ||
145 | fn process(map: std::collections::┃HashMap<String, String>) {} | ||
146 | |||
147 | // AFTER | ||
148 | use std::collections::HashMap; | ||
149 | |||
150 | fn process(map: HashMap<String, String>) {} | ||
151 | ``` | ||
152 | |||
139 | ## `apply_demorgan` | 153 | ## `apply_demorgan` |
140 | 154 | ||
141 | Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws). | 155 | Apply [De Morgan's law](https://en.wikipedia.org/wiki/De_Morgan%27s_laws). |
@@ -248,6 +262,18 @@ fn main() { | |||
248 | } | 262 | } |
249 | ``` | 263 | ``` |
250 | 264 | ||
265 | ## `flip_trait_bound` | ||
266 | |||
267 | Flips two trait bounds. | ||
268 | |||
269 | ```rust | ||
270 | // BEFORE | ||
271 | fn foo<T: Clone +┃ Copy>() { } | ||
272 | |||
273 | // AFTER | ||
274 | fn foo<T: Copy + Clone>() { } | ||
275 | ``` | ||
276 | |||
251 | ## `inline_local_variable` | 277 | ## `inline_local_variable` |
252 | 278 | ||
253 | Inlines local variable. | 279 | Inlines local variable. |
diff --git a/docs/user/features.md b/docs/user/features.md index 7ae2ca7b6..c160dd70b 100644 --- a/docs/user/features.md +++ b/docs/user/features.md | |||
@@ -99,24 +99,10 @@ Stop `cargo watch` | |||
99 | 99 | ||
100 | ### Assists (Code Actions) | 100 | ### Assists (Code Actions) |
101 | 101 | ||
102 | These are triggered in a particular context via light bulb. We use custom code on | 102 | Assists, or code actions, are small local refactorings, available in a particular context. |
103 | the VS Code side to be able to position cursor. `<|>` signifies cursor | 103 | They are usually triggered by a shortcut or by clicking a light bulb icon in the editor. |
104 | 104 | ||
105 | See [assists.md](./assists.md) | 105 | See [assists.md](./assists.md) for the list of available assists. |
106 | |||
107 | - Import path | ||
108 | |||
109 | ```rust | ||
110 | // before: | ||
111 | impl std::fmt::Debug<|> for Foo { | ||
112 | } | ||
113 | |||
114 | // after: | ||
115 | use std::fmt::Debug; | ||
116 | |||
117 | impl Debug<|> for Foo { | ||
118 | } | ||
119 | ``` | ||
120 | 106 | ||
121 | ### Magic Completions | 107 | ### Magic Completions |
122 | 108 | ||