5
5
Provides user with annotations above items for looking up references or impl blocks
6
6
and running/debugging binaries.
7
7
8
+ image::https://user-images.githubusercontent.com/48062697/113020672-b7c34f00-917a-11eb-8f6e-858735660a0e.png[]
9
+
8
10
9
11
=== Auto Import
10
12
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_assists/src/handlers/auto_import.rs#L10[auto_import.rs]
@@ -62,6 +64,8 @@ It has the following configurations:
62
64
63
65
In `VS Code` the configuration for this is `rust-analyzer.assist.importPrefix`.
64
66
67
+ image::https://user-images.githubusercontent.com/48062697/113020673-b85be580-917a-11eb-9022-59585f35d4f8.gif[]
68
+
65
69
66
70
=== Expand Macro Recursively
67
71
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/expand_macro.rs#L17[expand_macro.rs]
@@ -74,6 +78,8 @@ Shows the full macro expansion of the macro at current cursor.
74
78
| VS Code | **Rust Analyzer: Expand macro recursively**
75
79
|===
76
80
81
+ image::https://user-images.githubusercontent.com/48062697/113020648-b3973180-917a-11eb-84a9-ecb921293dc5.gif[]
82
+
77
83
78
84
=== Expand and Shrink Selection
79
85
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/extend_selection.rs#L15[extend_selection.rs]
@@ -89,6 +95,8 @@ This is a standard LSP feature and not a protocol extension.
89
95
| VS Code | kbd:[Alt+Shift+→], kbd:[Alt+Shift+←]
90
96
|===
91
97
98
+ image::https://user-images.githubusercontent.com/48062697/113020651-b42fc800-917a-11eb-8a4f-cf1a07859fac.gif[]
99
+
92
100
93
101
=== File Structure
94
102
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/file_structure.rs#L25[file_structure.rs]
@@ -105,6 +113,8 @@ Provides a tree of the symbols defined in the file. Can be used to
105
113
| VS Code | kbd:[Ctrl+Shift+O]
106
114
|===
107
115
116
+ image::https://user-images.githubusercontent.com/48062697/113020654-b42fc800-917a-11eb-8388-e7dc4d92b02e.gif[]
117
+
108
118
109
119
=== Find All References
110
120
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/references.rs#L42[references.rs]
@@ -117,6 +127,8 @@ Shows all references of the item at the cursor location
117
127
| VS Code | kbd:[Shift+Alt+F12]
118
128
|===
119
129
130
+ image::https://user-images.githubusercontent.com/48062697/113020670-b7c34f00-917a-11eb-8003-370ac5f2b3cb.gif[]
131
+
120
132
121
133
=== Format String Completion.
122
134
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_completion/src/completions/postfix/format_like.rs#L0[format_like.rs]
@@ -135,6 +147,8 @@ The following postfix snippets are available:
135
147
+ `logw` -> `log::warn!(...)`
136
148
+ `loge` -> `log::error!(...)`
137
149
150
+ image::https://user-images.githubusercontent.com/48062697/113020656-b560f500-917a-11eb-87de-02991f61beb8.gif[]
151
+
138
152
139
153
=== Go to Definition
140
154
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_definition.rs#L15[goto_definition.rs]
@@ -147,6 +161,8 @@ Navigates to the definition of an identifier.
147
161
| VS Code | kbd:[F12]
148
162
|===
149
163
164
+ image::https://user-images.githubusercontent.com/48062697/113065563-025fbe00-91b1-11eb-83e4-a5a703610b23.gif[]
165
+
150
166
151
167
=== Go to Implementation
152
168
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_implementation.rs#L10[goto_implementation.rs]
@@ -159,6 +175,8 @@ Navigates to the impl block of structs, enums or traits. Also implemented as a c
159
175
| VS Code | kbd:[Ctrl+F12]
160
176
|===
161
177
178
+ image::https://user-images.githubusercontent.com/48062697/113065566-02f85480-91b1-11eb-9288-aaad8abd8841.gif[]
179
+
162
180
163
181
=== Go to Type Definition
164
182
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/goto_type_definition.rs#L6[goto_type_definition.rs]
@@ -171,13 +189,17 @@ Navigates to the type of an identifier.
171
189
| VS Code | **Go to Type Definition*
172
190
|===
173
191
192
+ image::https://user-images.githubusercontent.com/48062697/113020657-b560f500-917a-11eb-9007-0f809733a338.gif[]
193
+
174
194
175
195
=== Hover
176
196
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/hover.rs#L81[hover.rs]
177
197
178
198
Shows additional information, like type of an expression or documentation for definition when "focusing" code.
179
199
Focusing is usually hovering with a mouse, but can also be triggered with a shortcut.
180
200
201
+ image::https://user-images.githubusercontent.com/48062697/113020658-b5f98b80-917a-11eb-9f88-3dbc27320c95.gif[]
202
+
181
203
182
204
=== Inlay Hints
183
205
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/inlay_hints.rs#L35[inlay_hints.rs]
@@ -201,6 +223,8 @@ https://github.com/rust-analyzer/rust-analyzer/issues/1623[1], https://github.co
201
223
| VS Code | **Rust Analyzer: Toggle inlay hints*
202
224
|===
203
225
226
+ image::https://user-images.githubusercontent.com/48062697/113020660-b5f98b80-917a-11eb-8d70-3be3fd558cdd.png[]
227
+
204
228
205
229
=== Join Lines
206
230
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/join_lines.rs#L13[join_lines.rs]
@@ -213,6 +237,8 @@ Join selected lines into one, smartly fixing up whitespace, trailing commas, and
213
237
| VS Code | **Rust Analyzer: Join lines**
214
238
|===
215
239
240
+ image::https://user-images.githubusercontent.com/48062697/113020661-b6922200-917a-11eb-87c4-b75acc028f11.gif[]
241
+
216
242
217
243
=== Magic Completions
218
244
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_completion/src/lib.rs#L34[lib.rs]
@@ -266,6 +292,8 @@ And the auto import completions, enabled with the `rust-analyzer.completion.auto
266
292
Those are the additional completion options with automatic `use` import and options from all project importable items,
267
293
fuzzy matched agains the completion imput.
268
294
295
+ image::https://user-images.githubusercontent.com/48062697/113020667-b72ab880-917a-11eb-8778-716cf26a0eb3.gif[]
296
+
269
297
270
298
=== Matching Brace
271
299
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/matching_brace.rs#L6[matching_brace.rs]
@@ -280,6 +308,8 @@ braces, so it won't confuse generics with comparisons.
280
308
| VS Code | **Rust Analyzer: Find matching brace**
281
309
|===
282
310
311
+ image::https://user-images.githubusercontent.com/48062697/113065573-04298180-91b1-11eb-8dec-d4e2a202f304.gif[]
312
+
283
313
284
314
=== Memory Usage
285
315
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide_db/src/apply_change.rs#L95[apply_change.rs]
@@ -291,10 +321,11 @@ Clears rust-analyzer's internal database and prints memory usage statistics.
291
321
292
322
| VS Code | **Rust Analyzer: Memory Usage (Clears Database)**
293
323
|===
324
+ image::https://user-images.githubusercontent.com/48062697/113065592-08559f00-91b1-11eb-8c96-64b88068ec02.gif[]
294
325
295
326
296
327
=== Move Item
297
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/move_item.rs#L16 [move_item.rs]
328
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/move_item.rs#L18 [move_item.rs]
298
329
299
330
Move item under cursor or selection up and down.
300
331
@@ -305,6 +336,8 @@ Move item under cursor or selection up and down.
305
336
| VS Code | **Rust Analyzer: Move item down**
306
337
|===
307
338
339
+ image::https://user-images.githubusercontent.com/48062697/113065576-04298180-91b1-11eb-91ce-4505e99ed598.gif[]
340
+
308
341
309
342
=== On Enter
310
343
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/typing/on_enter.rs#L15[on_enter.rs]
@@ -328,6 +361,8 @@ Add the following to `keybindings.json`:
328
361
}
329
362
----
330
363
364
+ image::https://user-images.githubusercontent.com/48062697/113065578-04c21800-91b1-11eb-82b8-22b8c481e645.gif[]
365
+
331
366
332
367
=== On Typing Assists
333
368
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/typing.rs#L38[typing.rs]
@@ -345,6 +380,9 @@ Add the following to `settings.json`:
345
380
"editor.formatOnType": true,
346
381
----
347
382
383
+ image::https://user-images.githubusercontent.com/48062697/113166163-69758500-923a-11eb-81ee-eb33ec380399.gif[]
384
+ image::https://user-images.githubusercontent.com/48062697/113171066-105c2000-923f-11eb-87ab-f4a263346567.gif[]
385
+
348
386
349
387
=== Parent Module
350
388
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/parent_module.rs#L12[parent_module.rs]
@@ -357,9 +395,11 @@ Navigates to the parent module of the current module.
357
395
| VS Code | **Rust Analyzer: Locate parent module**
358
396
|===
359
397
398
+ image::https://user-images.githubusercontent.com/48062697/113065580-04c21800-91b1-11eb-9a32-00086161c0bd.gif[]
399
+
360
400
361
401
=== Related Tests
362
- **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L127 [runnables.rs]
402
+ **Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L128 [runnables.rs]
363
403
364
404
Provides a sneak peek of all tests where the current item is used.
365
405
@@ -385,6 +425,8 @@ Renames the item below the cursor and all of its references
385
425
| VS Code | kbd:[F2]
386
426
|===
387
427
428
+ image::https://user-images.githubusercontent.com/48062697/113065582-055aae80-91b1-11eb-8ade-2b58e6d81883.gif[]
429
+
388
430
389
431
=== Run
390
432
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/runnables.rs#L90[runnables.rs]
@@ -398,6 +440,7 @@ to a shortcut!
398
440
399
441
| VS Code | **Rust Analyzer: Run**
400
442
|===
443
+ image::https://user-images.githubusercontent.com/48062697/113065583-055aae80-91b1-11eb-958f-d67efcaf6a2f.gif[]
401
444
402
445
403
446
=== Semantic Syntax Highlighting
@@ -411,6 +454,9 @@ It's up to the client to map those to specific colors.
411
454
The general rule is that a reference to an entity gets colored the same way as the entity itself.
412
455
We also give special modifier for `mut` and `&mut` local variables.
413
456
457
+ image::https://user-images.githubusercontent.com/48062697/113164457-06cfb980-9239-11eb-819b-0f93e646acf8.png[]
458
+ image::https://user-images.githubusercontent.com/48062697/113187625-f7f50100-9250-11eb-825e-91c58f236071.png[]
459
+
414
460
415
461
=== Show Syntax Tree
416
462
**Source:** https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/ide/src/syntax_tree.rs#L7[syntax_tree.rs]
@@ -423,6 +469,7 @@ rust-analyzer itself.
423
469
424
470
| VS Code | **Rust Analyzer: Show Syntax Tree**
425
471
|===
472
+ image::https://user-images.githubusercontent.com/48062697/113065586-068bdb80-91b1-11eb-9507-fee67f9f45a0.gif[]
426
473
427
474
428
475
=== Status
@@ -435,6 +482,7 @@ Shows internal statistic about memory usage of rust-analyzer.
435
482
436
483
| VS Code | **Rust Analyzer: Status**
437
484
|===
485
+ image::https://user-images.githubusercontent.com/48062697/113065584-05f34500-91b1-11eb-98cc-5c196f76be7f.gif[]
438
486
439
487
440
488
=== Structural Search and Replace
@@ -511,6 +559,7 @@ be parsed as a valid structural search and replace rule.
511
559
512
560
| VS Code | **Rust Analyzer: View Hir**
513
561
|===
562
+ image::https://user-images.githubusercontent.com/48062697/113065588-068bdb80-91b1-11eb-9a78-0b4ef1e972fb.gif[]
514
563
515
564
516
565
=== Workspace Symbol
0 commit comments