diff options
author | Aleksey Kladov <[email protected]> | 2020-05-31 09:14:36 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-05-31 09:14:36 +0100 |
commit | b795a07320e13bcbedb6435bcfddb3ecd0ed2bde (patch) | |
tree | d8cda2dc671833f42493e12f9eb56b782883f7b7 /docs | |
parent | 8915183d7da07a4b295e5e93a889dea4c15024a0 (diff) |
Doc more features
Diffstat (limited to 'docs')
-rw-r--r-- | docs/user/features.md | 48 | ||||
-rw-r--r-- | docs/user/readme.adoc | 7 |
2 files changed, 7 insertions, 48 deletions
diff --git a/docs/user/features.md b/docs/user/features.md index ba7ca15a6..ff8cb2d6e 100644 --- a/docs/user/features.md +++ b/docs/user/features.md | |||
@@ -5,60 +5,12 @@ you can use <kbd>Ctrl+Shift+P</kbd> to search for the corresponding action. | |||
5 | ### Commands <kbd>ctrl+shift+p</kbd> | 5 | ### Commands <kbd>ctrl+shift+p</kbd> |
6 | 6 | ||
7 | 7 | ||
8 | |||
9 | |||
10 | #### Expand Macro Recursively | ||
11 | |||
12 | Shows the full macro expansion of the macro at current cursor. | ||
13 | |||
14 | #### Status | ||
15 | |||
16 | Shows internal statistic about memory usage of rust-analyzer. | ||
17 | |||
18 | #### Show RA Version | ||
19 | |||
20 | Show current rust-analyzer version. | ||
21 | |||
22 | #### Toggle inlay hints | 8 | #### Toggle inlay hints |
23 | 9 | ||
24 | Toggle inlay hints view for the current workspace. | 10 | Toggle inlay hints view for the current workspace. |
25 | It is recommended to assign a shortcut for this command to quickly turn off | 11 | It is recommended to assign a shortcut for this command to quickly turn off |
26 | inlay hints when they prevent you from reading/writing the code. | 12 | inlay hints when they prevent you from reading/writing the code. |
27 | 13 | ||
28 | #### Run Garbage Collection | ||
29 | |||
30 | Manually triggers GC. | ||
31 | |||
32 | #### Start Cargo Watch | ||
33 | |||
34 | Start `cargo watch` for live error highlighting. Will prompt to install if it's not already installed. | ||
35 | |||
36 | #### Stop Cargo Watch | ||
37 | |||
38 | Stop `cargo watch`. | ||
39 | |||
40 | #### Structural Seach and Replace | ||
41 | |||
42 | Search and replace with named wildcards that will match any expression. | ||
43 | The syntax for a structural search replace command is `<search_pattern> ==>> <replace_pattern>`. A `$<name>:expr` placeholder in the search pattern will match any expression and `$<name>` will reference it in the replacement. Available via the command `rust-analyzer.ssr`. | ||
44 | |||
45 | ```rust | ||
46 | // Using structural search replace command [foo($a:expr, $b:expr) ==>> ($a).foo($b)] | ||
47 | |||
48 | // BEFORE | ||
49 | String::from(foo(y + 5, z)) | ||
50 | |||
51 | // AFTER | ||
52 | String::from((y + 5).foo(z)) | ||
53 | ``` | ||
54 | |||
55 | ### Assists (Code Actions) | ||
56 | |||
57 | Assists, or code actions, are small local refactorings, available in a particular context. | ||
58 | They are usually triggered by a shortcut or by clicking a light bulb icon in the editor. | ||
59 | |||
60 | See [assists.md](./assists.md) for the list of available assists. | ||
61 | |||
62 | ### Magic Completions | 14 | ### Magic Completions |
63 | 15 | ||
64 | In addition to usual reference completion, rust-analyzer provides some ✨magic✨ | 16 | In addition to usual reference completion, rust-analyzer provides some ✨magic✨ |
diff --git a/docs/user/readme.adoc b/docs/user/readme.adoc index 7b159bfc6..8cfa41144 100644 --- a/docs/user/readme.adoc +++ b/docs/user/readme.adoc | |||
@@ -272,3 +272,10 @@ Gnome Builder currently has support for RLS, and there's no way to configure the | |||
272 | == Features | 272 | == Features |
273 | 273 | ||
274 | include::./generated_features.adoc[] | 274 | include::./generated_features.adoc[] |
275 | |||
276 | == Assists (Code Actions) | ||
277 | |||
278 | Assists, or code actions, are small local refactorings, available in a particular context. | ||
279 | They are usually triggered by a shortcut or by clicking a light bulb icon in the editor. | ||
280 | |||
281 | See [assists.md](./assists.md) for the list of available assists. | ||