aboutsummaryrefslogtreecommitdiff
path: root/docs/user/features.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/user/features.md')
-rw-r--r--docs/user/features.md30
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 @@
1This documents is an index of features that rust-analyzer language server 1This document is an index of features that the rust-analyzer language server
2provides. Shortcuts are for the default VS Code layout. If there's no shortcut, 2provides. Shortcuts are for the default VS Code layout. If there's no shortcut,
3you can use <kbd>Ctrl+Shift+P</kbd> to search for the corresponding action. 3you 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
7Uses fuzzy-search to find types, modules and function by name across your 7Uses fuzzy-search to find types, modules and functions by name across your
8project and dependencies. This is **the** most useful feature, which improves code 8project and dependencies. This is **the** most useful feature, which improves code
9navigation tremendously. It mostly works on top of the built-in LSP 9navigation tremendously. It mostly works on top of the built-in LSP
10functionality, however `#` and `*` symbols can be used to narrow down the 10functionality, 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
18That is, `#` switches from "types" to all symbols, `*` switches from the current 18That is, `#` switches from "types" to all symbols, `*` switches from the current
19workspace to dependencies. 19workspace to dependencies.
@@ -30,7 +30,7 @@ Provides a tree of the symbols defined in the file. Can be used to
30 30
31Some features trigger on typing certain characters: 31Some 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
61Shows popup suggesting to run a test/benchmark/binary **at the current cursor 61Shows a popup suggesting to run a test/benchmark/binary **at the current cursor
62location**. Super useful for repeatedly running just a single test. Do bind this 62location**. Super useful for repeatedly running just a single test. Do bind this
63to a shortcut! 63to 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
90Shows internal statistic about memory usage of rust-analyzer 90Shows internal statistic about memory usage of rust-analyzer.
91 91
92#### Show RA Version 92#### Show RA Version
93 93
94Show current rust-analyzer version 94Show current rust-analyzer version.
95 95
96#### Run garbage collection 96#### Run Garbage Collection
97 97
98Manually triggers GC 98Manually 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
106Stop `cargo watch` 106Stop `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
122still want to complete it, to get ` { }` for free! `return` is inserted with a 122still want to complete it, to get ` { }` for free! `return` is inserted with a
123space or `;` depending on the return type of the function. 123space or `;` depending on the return type of the function.
124 124
125When completing a function call, `()` are automatically inserted. If function 125When completing a function call, `()` are automatically inserted. If a function
126takes arguments, cursor is positioned inside the parenthesis. 126takes arguments, the cursor is positioned inside the parenthesis.
127 127
128There are postifx completions, which can be triggerd by typing something like 128There 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
152Experimental feature to let rust-analyzer highlight Rust code instead of using the 152Experimental feature to let rust-analyzer highlight Rust code instead of using the
153default highlighter. 153default highlighter.
154 154
155#### Rainbow highlighting 155#### Rainbow Highlighting
156 156
157Experimental feature that, given code highlighting using rust-analyzer is 157Experimental feature that, given code highlighting using rust-analyzer is
158active, will pick unique colors for identifiers. 158active, will pick unique colors for identifiers.