From 4a83aae09849123dbbbc5726b07c2601a14397a8 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 26 Oct 2019 19:58:18 +0300 Subject: support range selection in assist docs --- docs/user/assists.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'docs') 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() { (1 + 2) * 4; } ``` + +## `introduce_variable` + +Extracts subexpression into a variable. + +```rust +// BEFORE +fn main() { + <|>(1 + 2)<|> * 4; +} + +// AFTER +fn main() { + let var_name = (1 + 2); + var_name * 4; +} +``` -- cgit v1.2.3