diff options
author | Aleksey Kladov <[email protected]> | 2019-10-26 17:58:18 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-10-26 18:57:23 +0100 |
commit | 4a83aae09849123dbbbc5726b07c2601a14397a8 (patch) | |
tree | b8944447b98e8b0b25ac95d0465210312bf4cd57 /docs | |
parent | 733fd64260793a0f7335e4f75ba9197d5fa98b70 (diff) |
support range selection in assist docs
Diffstat (limited to 'docs')
-rw-r--r-- | docs/user/assists.md | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/user/assists.md b/docs/user/assists.md index 8e2e8cc94..182f07e98 100644 --- a/docs/user/assists.md +++ b/docs/user/assists.md | |||
@@ -245,3 +245,20 @@ fn main() { | |||
245 | (1 + 2) * 4; | 245 | (1 + 2) * 4; |
246 | } | 246 | } |
247 | ``` | 247 | ``` |
248 | |||
249 | ## `introduce_variable` | ||
250 | |||
251 | Extracts subexpression into a variable. | ||
252 | |||
253 | ```rust | ||
254 | // BEFORE | ||
255 | fn main() { | ||
256 | <|>(1 + 2)<|> * 4; | ||
257 | } | ||
258 | |||
259 | // AFTER | ||
260 | fn main() { | ||
261 | let var_name = (1 + 2); | ||
262 | var_name * 4; | ||
263 | } | ||
264 | ``` | ||