1
1
=== Expand Macro Recursively
2
2
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/expand_macro.rs[expand_macro.rs]
3
3
4
-
5
4
Shows the full macro expansion of the macro at current cursor.
6
5
7
6
|===
@@ -14,7 +13,6 @@ Shows the full macro expansion of the macro at current cursor.
14
13
=== Extend Selection
15
14
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/extend_selection.rs[extend_selection.rs]
16
15
17
-
18
16
Extends the current selection to the encompassing syntactic construct
19
17
(expression, statement, item, module, etc). It works with multiple cursors.
20
18
@@ -28,7 +26,6 @@ Extends the current selection to the encompassing syntactic construct
28
26
=== File Structure
29
27
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/display/structure.rs[structure.rs]
30
28
31
-
32
29
Provides a tree of the symbols defined in the file. Can be used to
33
30
34
31
* fuzzy search symbol in a file (super useful)
@@ -45,7 +42,6 @@ Provides a tree of the symbols defined in the file. Can be used to
45
42
=== Go to Definition
46
43
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/goto_definition.rs[goto_definition.rs]
47
44
48
-
49
45
Navigates to the definition of an identifier.
50
46
51
47
|===
@@ -58,7 +54,6 @@ Navigates to the definition of an identifier.
58
54
=== Go to Implementation
59
55
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/goto_implementation.rs[goto_implementation.rs]
60
56
61
-
62
57
Navigates to the impl block of structs, enums or traits. Also implemented as a code lens.
63
58
64
59
|===
@@ -71,7 +66,6 @@ Navigates to the impl block of structs, enums or traits. Also implemented as a c
71
66
=== Go to Type Definition
72
67
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/goto_type_definition.rs[goto_type_definition.rs]
73
68
74
-
75
69
Navigates to the type of an identifier.
76
70
77
71
|===
@@ -84,15 +78,13 @@ Navigates to the type of an identifier.
84
78
=== Hover
85
79
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/hover.rs[hover.rs]
86
80
87
-
88
81
Shows additional information, like type of an expression or documentation for definition when "focusing" code.
89
82
Focusing is usually hovering with a mouse, but can also be triggered with a shortcut.
90
83
91
84
92
85
=== Inlay Hints
93
86
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/inlay_hints.rs[inlay_hints.rs]
94
87
95
-
96
88
rust-analyzer shows additional information inline with the source code.
97
89
Editors usually render this using read-only virtual text snippets interspersed with code.
98
90
@@ -116,7 +108,6 @@ https://github.com/rust-analyzer/rust-analyzer/issues/1623[1], https://github.co
116
108
=== Join Lines
117
109
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/join_lines.rs[join_lines.rs]
118
110
119
-
120
111
Join selected lines into one, smartly fixing up whitespace, trailing commas, and braces.
121
112
122
113
|===
@@ -129,7 +120,6 @@ Join selected lines into one, smartly fixing up whitespace, trailing commas, and
129
120
=== Magic Completions
130
121
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/completion.rs[completion.rs]
131
122
132
-
133
123
In addition to usual reference completion, rust-analyzer provides some ✨magic✨
134
124
completions as well:
135
125
@@ -175,7 +165,6 @@ mod tests {
175
165
=== Matching Brace
176
166
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/matching_brace.rs[matching_brace.rs]
177
167
178
-
179
168
If the cursor is on any brace (`<>(){}[]`) which is a part of a brace-pair,
180
169
moves cursor to the matching brace. It uses the actual parser to determine
181
170
braces, so it won't confuse generics with comparisons.
@@ -190,7 +179,6 @@ braces, so it won't confuse generics with comparisons.
190
179
=== On Typing Assists
191
180
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/typing.rs[typing.rs]
192
181
193
-
194
182
Some features trigger on typing certain characters:
195
183
196
184
- typing `let =` tries to smartly add `;` if `=` is followed by an existing expression
@@ -201,7 +189,6 @@ Some features trigger on typing certain characters:
201
189
=== Parent Module
202
190
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/parent_module.rs[parent_module.rs]
203
191
204
-
205
192
Navigates to the parent module of the current module.
206
193
207
194
|===
@@ -214,7 +201,6 @@ Navigates to the parent module of the current module.
214
201
=== Run
215
202
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/runnables.rs[runnables.rs]
216
203
217
-
218
204
Shows a popup suggesting to run a test/benchmark/binary **at the current cursor
219
205
location**. Super useful for repeatedly running just a single test. Do bind this
220
206
to a shortcut!
@@ -229,7 +215,6 @@ to a shortcut!
229
215
=== Semantic Syntax Highlighting
230
216
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/syntax_highlighting.rs[syntax_highlighting.rs]
231
217
232
-
233
218
rust-analyzer highlights the code semantically.
234
219
For example, `bar` in `foo::Bar` might be colored differently depending on whether `Bar` is an enum or a trait.
235
220
rust-analyzer does not specify colors directly, instead it assigns tag (like `struct`) and a set of modifiers (like `declaration`) to each token.
@@ -242,7 +227,6 @@ We also give special modifier for `mut` and `&mut` local variables.
242
227
=== Show Syntax Tree
243
228
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/syntax_tree.rs[syntax_tree.rs]
244
229
245
-
246
230
Shows the parse tree of the current file. It exists mostly for debugging
247
231
rust-analyzer itself.
248
232
@@ -256,7 +240,6 @@ rust-analyzer itself.
256
240
=== Status
257
241
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/status.rs[status.rs]
258
242
259
-
260
243
Shows internal statistic about memory usage of rust-analyzer.
261
244
262
245
|===
@@ -269,7 +252,6 @@ Shows internal statistic about memory usage of rust-analyzer.
269
252
=== Structural Seach and Replace
270
253
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide/src/ssr.rs[ssr.rs]
271
254
272
-
273
255
Search and replace with named wildcards that will match any expression.
274
256
The syntax for a structural search replace command is `<search_pattern> ==>> <replace_pattern>`.
275
257
A `$<name>:expr` placeholder in the search pattern will match any expression and `$<name>` will reference it in the replacement.
@@ -295,7 +277,6 @@ String::from((y + 5).foo(z))
295
277
=== Workspace Symbol
296
278
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ra_ide_db/src/symbol_index.rs[symbol_index.rs]
297
279
298
-
299
280
Uses fuzzy-search to find types, modules and functions by name across your
300
281
project and dependencies. This is **the** most useful feature, which improves code
301
282
navigation tremendously. It mostly works on top of the built-in LSP
0 commit comments