diff options
Diffstat (limited to 'docs/user/features.md')
-rw-r--r-- | docs/user/features.md | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/docs/user/features.md b/docs/user/features.md index a00fa35da..f705e5115 100644 --- a/docs/user/features.md +++ b/docs/user/features.md | |||
@@ -1,10 +1,10 @@ | |||
1 | This documents is an index of features that rust-analyzer language server | 1 | This document is an index of features that the rust-analyzer language server |
2 | provides. Shortcuts are for the default VS Code layout. If there's no shortcut, | 2 | provides. Shortcuts are for the default VS Code layout. If there's no shortcut, |
3 | you can use <kbd>Ctrl+Shift+P</kbd> to search for the corresponding action. | 3 | you can use <kbd>Ctrl+Shift+P</kbd> to search for the corresponding action. |
4 | 4 | ||
5 | ### Workspace Symbol <kbd>ctrl+t</kbd> | 5 | ### Workspace Symbol <kbd>ctrl+t</kbd> |
6 | 6 | ||
7 | Uses fuzzy-search to find types, modules and function by name across your | 7 | Uses fuzzy-search to find types, modules and functions by name across your |
8 | project and dependencies. This is **the** most useful feature, which improves code | 8 | project and dependencies. This is **the** most useful feature, which improves code |
9 | navigation tremendously. It mostly works on top of the built-in LSP | 9 | navigation tremendously. It mostly works on top of the built-in LSP |
10 | functionality, however `#` and `*` symbols can be used to narrow down the | 10 | functionality, however `#` and `*` symbols can be used to narrow down the |
@@ -13,7 +13,7 @@ search. Specifically, | |||
13 | - `Foo` searches for `Foo` type in the current workspace | 13 | - `Foo` searches for `Foo` type in the current workspace |
14 | - `foo#` searches for `foo` function in the current workspace | 14 | - `foo#` searches for `foo` function in the current workspace |
15 | - `Foo*` searches for `Foo` type among dependencies, including `stdlib` | 15 | - `Foo*` searches for `Foo` type among dependencies, including `stdlib` |
16 | - `foo#*` searches for `foo` function among dependencies. | 16 | - `foo#*` searches for `foo` function among dependencies |
17 | 17 | ||
18 | That is, `#` switches from "types" to all symbols, `*` switches from the current | 18 | That is, `#` switches from "types" to all symbols, `*` switches from the current |
19 | workspace to dependencies. | 19 | workspace to dependencies. |
@@ -30,7 +30,7 @@ Provides a tree of the symbols defined in the file. Can be used to | |||
30 | 30 | ||
31 | Some features trigger on typing certain characters: | 31 | Some features trigger on typing certain characters: |
32 | 32 | ||
33 | - typing `let =` tries to smartly add `;` if `=` is followed by an existing expression. | 33 | - typing `let =` tries to smartly add `;` if `=` is followed by an existing expression |
34 | - Enter inside comments automatically inserts `///` | 34 | - Enter inside comments automatically inserts `///` |
35 | - typing `.` in a chain method call auto-indents | 35 | - typing `.` in a chain method call auto-indents |
36 | 36 | ||
@@ -58,7 +58,7 @@ Navigates to the type of an identifier. | |||
58 | 58 | ||
59 | #### Run | 59 | #### Run |
60 | 60 | ||
61 | Shows popup suggesting to run a test/benchmark/binary **at the current cursor | 61 | Shows a popup suggesting to run a test/benchmark/binary **at the current cursor |
62 | location**. Super useful for repeatedly running just a single test. Do bind this | 62 | location**. Super useful for repeatedly running just a single test. Do bind this |
63 | to a shortcut! | 63 | to a shortcut! |
64 | 64 | ||
@@ -87,15 +87,15 @@ Shows the full macro expansion of the macro at current cursor. | |||
87 | 87 | ||
88 | #### Status | 88 | #### Status |
89 | 89 | ||
90 | Shows internal statistic about memory usage of rust-analyzer | 90 | Shows internal statistic about memory usage of rust-analyzer. |
91 | 91 | ||
92 | #### Show RA Version | 92 | #### Show RA Version |
93 | 93 | ||
94 | Show current rust-analyzer version | 94 | Show current rust-analyzer version. |
95 | 95 | ||
96 | #### Run garbage collection | 96 | #### Run Garbage Collection |
97 | 97 | ||
98 | Manually triggers GC | 98 | Manually triggers GC. |
99 | 99 | ||
100 | #### Start Cargo Watch | 100 | #### Start Cargo Watch |
101 | 101 | ||
@@ -103,7 +103,7 @@ Start `cargo watch` for live error highlighting. Will prompt to install if it's | |||
103 | 103 | ||
104 | #### Stop Cargo Watch | 104 | #### Stop Cargo Watch |
105 | 105 | ||
106 | Stop `cargo watch` | 106 | Stop `cargo watch`. |
107 | 107 | ||
108 | ### Assists (Code Actions) | 108 | ### Assists (Code Actions) |
109 | 109 | ||
@@ -122,11 +122,11 @@ is placed at the appropriate position. Even though `if` is easy to type, you | |||
122 | still want to complete it, to get ` { }` for free! `return` is inserted with a | 122 | still want to complete it, to get ` { }` for free! `return` is inserted with a |
123 | space or `;` depending on the return type of the function. | 123 | space or `;` depending on the return type of the function. |
124 | 124 | ||
125 | When completing a function call, `()` are automatically inserted. If function | 125 | When completing a function call, `()` are automatically inserted. If a function |
126 | takes arguments, cursor is positioned inside the parenthesis. | 126 | takes arguments, the cursor is positioned inside the parenthesis. |
127 | 127 | ||
128 | There are postifx completions, which can be triggerd by typing something like | 128 | There are postifx completions, which can be triggerd by typing something like |
129 | `foo().if`. The word after `.` determines postifx completion, possible variants are: | 129 | `foo().if`. The word after `.` determines postifx completion. Possible variants are: |
130 | 130 | ||
131 | - `expr.if` -> `if expr {}` | 131 | - `expr.if` -> `if expr {}` |
132 | - `expr.match` -> `match expr {}` | 132 | - `expr.match` -> `match expr {}` |
@@ -147,12 +147,12 @@ There also snippet completions: | |||
147 | 147 | ||
148 | - `tfn` -> `#[test] fn f(){}` | 148 | - `tfn` -> `#[test] fn f(){}` |
149 | 149 | ||
150 | ### Code highlighting | 150 | ### Code Highlighting |
151 | 151 | ||
152 | Experimental feature to let rust-analyzer highlight Rust code instead of using the | 152 | Experimental feature to let rust-analyzer highlight Rust code instead of using the |
153 | default highlighter. | 153 | default highlighter. |
154 | 154 | ||
155 | #### Rainbow highlighting | 155 | #### Rainbow Highlighting |
156 | 156 | ||
157 | Experimental feature that, given code highlighting using rust-analyzer is | 157 | Experimental feature that, given code highlighting using rust-analyzer is |
158 | active, will pick unique colors for identifiers. | 158 | active, will pick unique colors for identifiers. |