diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-22 11:50:36 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-22 11:50:36 +0000 |
commit | 9999660c9082e54b1afb868848f19edd96284d80 (patch) | |
tree | d2fb72429c33b25cfea5d315e8cf962dd7464a73 /docs | |
parent | f9acb4333f7c07969184d64793a84f8ad8efb309 (diff) | |
parent | 818a4ea27225a4176fb191bed5eb329c807045a7 (diff) |
Merge #3269
3269: Add inlay hints documentation r=flodiebold a=SomeoneToIgnore
Closes https://github.com/rust-analyzer/rust-analyzer/issues/3267
Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/user/features.md | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/docs/user/features.md b/docs/user/features.md index f705e5115..a9cff34d2 100644 --- a/docs/user/features.md +++ b/docs/user/features.md | |||
@@ -156,3 +156,28 @@ default highlighter. | |||
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. |
159 | |||
160 | ### Code hints | ||
161 | |||
162 | Rust-analyzer has two types of hints to show the information about the code: | ||
163 | |||
164 | * hover hints, appearing on hover on any element. | ||
165 | |||
166 | These contain extended information on the hovered language item. | ||
167 | |||
168 | * inlay hints, shown near the element hinted directly in the editor. | ||
169 | |||
170 | Two types of inlay hints are displayed currently: | ||
171 | |||
172 | * type hints, displaying the minimal information on the type of the expression (if the information is available) | ||
173 | * parameter name hints, displaying the names of the parameters in the corresponding methods | ||
174 | |||
175 | #### VS Code | ||
176 | |||
177 | In VS Code, the following settings can be used to configure the inlay hints: | ||
178 | |||
179 | * `rust-analyzer.displayInlayHints` — toggles inlay hints display on or off | ||
180 | * `rust-analyzer.maxInlayHintLength` — shortens the hints if their length exceeds the value specified. If no value is specified (`null`), no shortening is applied. | ||
181 | |||
182 | **Note:** VS Code does not have native support for inlay hints [yet](https://github.com/microsoft/vscode/issues/16221) and the hints are implemented using decorations. | ||
183 | This approach has limitations: the caret movement near the end of the hint may look [weird](https://github.com/rust-analyzer/rust-analyzer/issues/1623). | ||