]> git.lizzy.rs Git - rust.git/blob - docs/user/generated_config.adoc
fix: Fix lifetime elision hint configuration key
[rust.git] / docs / user / generated_config.adoc
1 [[rust-analyzer.assist.exprFillDefault]]rust-analyzer.assist.exprFillDefault (default: `"todo"`)::
2 +
3 --
4 Placeholder for missing expressions in assists.
5 --
6 [[rust-analyzer.assist.importGranularity]]rust-analyzer.assist.importGranularity (default: `"crate"`)::
7 +
8 --
9 How imports should be grouped into use statements.
10 --
11 [[rust-analyzer.assist.importEnforceGranularity]]rust-analyzer.assist.importEnforceGranularity (default: `false`)::
12 +
13 --
14 Whether to enforce the import granularity setting for all files. If set to false rust-analyzer will try to keep import styles consistent per file.
15 --
16 [[rust-analyzer.assist.importPrefix]]rust-analyzer.assist.importPrefix (default: `"plain"`)::
17 +
18 --
19 The path structure for newly inserted paths to use.
20 --
21 [[rust-analyzer.assist.importGroup]]rust-analyzer.assist.importGroup (default: `true`)::
22 +
23 --
24 Group inserted imports by the https://rust-analyzer.github.io/manual.html#auto-import[following order]. Groups are separated by newlines.
25 --
26 [[rust-analyzer.assist.allowMergingIntoGlobImports]]rust-analyzer.assist.allowMergingIntoGlobImports (default: `true`)::
27 +
28 --
29 Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`.
30 --
31 [[rust-analyzer.cache.warmup]]rust-analyzer.cache.warmup (default: `true`)::
32 +
33 --
34 Warm up caches on project load.
35 --
36 [[rust-analyzer.callInfo.full]]rust-analyzer.callInfo.full (default: `true`)::
37 +
38 --
39 Show function name and docs in parameter hints.
40 --
41 [[rust-analyzer.cargo.autoreload]]rust-analyzer.cargo.autoreload (default: `true`)::
42 +
43 --
44 Automatically refresh project info via `cargo metadata` on
45 `Cargo.toml` changes.
46 --
47 [[rust-analyzer.cargo.allFeatures]]rust-analyzer.cargo.allFeatures (default: `false`)::
48 +
49 --
50 Activate all available features (`--all-features`).
51 --
52 [[rust-analyzer.cargo.unsetTest]]rust-analyzer.cargo.unsetTest (default: `["core"]`)::
53 +
54 --
55 Unsets `#[cfg(test)]` for the specified crates.
56 --
57 [[rust-analyzer.cargo.features]]rust-analyzer.cargo.features (default: `[]`)::
58 +
59 --
60 List of features to activate.
61 --
62 [[rust-analyzer.cargo.runBuildScripts]]rust-analyzer.cargo.runBuildScripts (default: `true`)::
63 +
64 --
65 Run build scripts (`build.rs`) for more precise code analysis.
66 --
67 [[rust-analyzer.cargo.useRustcWrapperForBuildScripts]]rust-analyzer.cargo.useRustcWrapperForBuildScripts (default: `true`)::
68 +
69 --
70 Use `RUSTC_WRAPPER=rust-analyzer` when running build scripts to
71 avoid compiling unnecessary things.
72 --
73 [[rust-analyzer.cargo.noDefaultFeatures]]rust-analyzer.cargo.noDefaultFeatures (default: `false`)::
74 +
75 --
76 Do not activate the `default` feature.
77 --
78 [[rust-analyzer.cargo.target]]rust-analyzer.cargo.target (default: `null`)::
79 +
80 --
81 Compilation target (target triple).
82 --
83 [[rust-analyzer.cargo.noSysroot]]rust-analyzer.cargo.noSysroot (default: `false`)::
84 +
85 --
86 Internal config for debugging, disables loading of sysroot crates.
87 --
88 [[rust-analyzer.checkOnSave.enable]]rust-analyzer.checkOnSave.enable (default: `true`)::
89 +
90 --
91 Run specified `cargo check` command for diagnostics on save.
92 --
93 [[rust-analyzer.checkOnSave.allFeatures]]rust-analyzer.checkOnSave.allFeatures (default: `null`)::
94 +
95 --
96 Check with all features (`--all-features`).
97 Defaults to `#rust-analyzer.cargo.allFeatures#`.
98 --
99 [[rust-analyzer.checkOnSave.allTargets]]rust-analyzer.checkOnSave.allTargets (default: `true`)::
100 +
101 --
102 Check all targets and tests (`--all-targets`).
103 --
104 [[rust-analyzer.checkOnSave.command]]rust-analyzer.checkOnSave.command (default: `"check"`)::
105 +
106 --
107 Cargo command to use for `cargo check`.
108 --
109 [[rust-analyzer.checkOnSave.noDefaultFeatures]]rust-analyzer.checkOnSave.noDefaultFeatures (default: `null`)::
110 +
111 --
112 Do not activate the `default` feature.
113 --
114 [[rust-analyzer.checkOnSave.target]]rust-analyzer.checkOnSave.target (default: `null`)::
115 +
116 --
117 Check for a specific target. Defaults to
118 `#rust-analyzer.cargo.target#`.
119 --
120 [[rust-analyzer.checkOnSave.extraArgs]]rust-analyzer.checkOnSave.extraArgs (default: `[]`)::
121 +
122 --
123 Extra arguments for `cargo check`.
124 --
125 [[rust-analyzer.checkOnSave.features]]rust-analyzer.checkOnSave.features (default: `null`)::
126 +
127 --
128 List of features to activate. Defaults to
129 `#rust-analyzer.cargo.features#`.
130 --
131 [[rust-analyzer.checkOnSave.overrideCommand]]rust-analyzer.checkOnSave.overrideCommand (default: `null`)::
132 +
133 --
134 Advanced option, fully override the command rust-analyzer uses for
135 checking. The command should include `--message-format=json` or
136 similar option.
137 --
138 [[rust-analyzer.completion.addCallArgumentSnippets]]rust-analyzer.completion.addCallArgumentSnippets (default: `true`)::
139 +
140 --
141 Whether to add argument snippets when completing functions.
142 Only applies when `#rust-analyzer.completion.addCallParenthesis#` is set.
143 --
144 [[rust-analyzer.completion.addCallParenthesis]]rust-analyzer.completion.addCallParenthesis (default: `true`)::
145 +
146 --
147 Whether to add parenthesis when completing functions.
148 --
149 [[rust-analyzer.completion.snippets]]rust-analyzer.completion.snippets::
150 +
151 --
152 Default:
153 ----
154 {
155             "Arc::new": {
156                 "postfix": "arc",
157                 "body": "Arc::new(${receiver})",
158                 "requires": "std::sync::Arc",
159                 "description": "Put the expression into an `Arc`",
160                 "scope": "expr"
161             },
162             "Rc::new": {
163                 "postfix": "rc",
164                 "body": "Rc::new(${receiver})",
165                 "requires": "std::rc::Rc",
166                 "description": "Put the expression into an `Rc`",
167                 "scope": "expr"
168             },
169             "Box::pin": {
170                 "postfix": "pinbox",
171                 "body": "Box::pin(${receiver})",
172                 "requires": "std::boxed::Box",
173                 "description": "Put the expression into a pinned `Box`",
174                 "scope": "expr"
175             },
176             "Ok": {
177                 "postfix": "ok",
178                 "body": "Ok(${receiver})",
179                 "description": "Wrap the expression in a `Result::Ok`",
180                 "scope": "expr"
181             },
182             "Err": {
183                 "postfix": "err",
184                 "body": "Err(${receiver})",
185                 "description": "Wrap the expression in a `Result::Err`",
186                 "scope": "expr"
187             },
188             "Some": {
189                 "postfix": "some",
190                 "body": "Some(${receiver})",
191                 "description": "Wrap the expression in an `Option::Some`",
192                 "scope": "expr"
193             }
194         }
195 ----
196 Custom completion snippets.
197
198 --
199 [[rust-analyzer.completion.postfix.enable]]rust-analyzer.completion.postfix.enable (default: `true`)::
200 +
201 --
202 Whether to show postfix snippets like `dbg`, `if`, `not`, etc.
203 --
204 [[rust-analyzer.completion.autoimport.enable]]rust-analyzer.completion.autoimport.enable (default: `true`)::
205 +
206 --
207 Toggles the additional completions that automatically add imports when completed.
208 Note that your client must specify the `additionalTextEdits` LSP client capability to truly have this feature enabled.
209 --
210 [[rust-analyzer.completion.autoself.enable]]rust-analyzer.completion.autoself.enable (default: `true`)::
211 +
212 --
213 Toggles the additional completions that automatically show method calls and field accesses
214 with `self` prefixed to them when inside a method.
215 --
216 [[rust-analyzer.completion.privateEditable.enable]]rust-analyzer.completion.privateEditable.enable (default: `false`)::
217 +
218 --
219 Enables completions of private items and fields that are defined in the current workspace even if they are not visible at the current position.
220 --
221 [[rust-analyzer.diagnostics.enable]]rust-analyzer.diagnostics.enable (default: `true`)::
222 +
223 --
224 Whether to show native rust-analyzer diagnostics.
225 --
226 [[rust-analyzer.diagnostics.enableExperimental]]rust-analyzer.diagnostics.enableExperimental (default: `true`)::
227 +
228 --
229 Whether to show experimental rust-analyzer diagnostics that might
230 have more false positives than usual.
231 --
232 [[rust-analyzer.diagnostics.disabled]]rust-analyzer.diagnostics.disabled (default: `[]`)::
233 +
234 --
235 List of rust-analyzer diagnostics to disable.
236 --
237 [[rust-analyzer.diagnostics.remapPrefix]]rust-analyzer.diagnostics.remapPrefix (default: `{}`)::
238 +
239 --
240 Map of prefixes to be substituted when parsing diagnostic file paths.
241 This should be the reverse mapping of what is passed to `rustc` as `--remap-path-prefix`.
242 --
243 [[rust-analyzer.diagnostics.warningsAsHint]]rust-analyzer.diagnostics.warningsAsHint (default: `[]`)::
244 +
245 --
246 List of warnings that should be displayed with hint severity.
247
248 The warnings will be indicated by faded text or three dots in code
249 and will not show up in the `Problems Panel`.
250 --
251 [[rust-analyzer.diagnostics.warningsAsInfo]]rust-analyzer.diagnostics.warningsAsInfo (default: `[]`)::
252 +
253 --
254 List of warnings that should be displayed with info severity.
255
256 The warnings will be indicated by a blue squiggly underline in code
257 and a blue icon in the `Problems Panel`.
258 --
259 [[rust-analyzer.experimental.procAttrMacros]]rust-analyzer.experimental.procAttrMacros (default: `true`)::
260 +
261 --
262 Expand attribute macros.
263 --
264 [[rust-analyzer.files.watcher]]rust-analyzer.files.watcher (default: `"client"`)::
265 +
266 --
267 Controls file watching implementation.
268 --
269 [[rust-analyzer.files.excludeDirs]]rust-analyzer.files.excludeDirs (default: `[]`)::
270 +
271 --
272 These directories will be ignored by rust-analyzer. They are
273 relative to the workspace root, and globs are not supported. You may
274 also need to add the folders to Code's `files.watcherExclude`.
275 --
276 [[rust-analyzer.highlightRelated.references]]rust-analyzer.highlightRelated.references (default: `true`)::
277 +
278 --
279 Enables highlighting of related references while hovering your mouse above any identifier.
280 --
281 [[rust-analyzer.highlightRelated.exitPoints]]rust-analyzer.highlightRelated.exitPoints (default: `true`)::
282 +
283 --
284 Enables highlighting of all exit points while hovering your mouse above any `return`, `?`, or return type arrow (`->`).
285 --
286 [[rust-analyzer.highlightRelated.breakPoints]]rust-analyzer.highlightRelated.breakPoints (default: `true`)::
287 +
288 --
289 Enables highlighting of related references while hovering your mouse `break`, `loop`, `while`, or `for` keywords.
290 --
291 [[rust-analyzer.highlightRelated.yieldPoints]]rust-analyzer.highlightRelated.yieldPoints (default: `true`)::
292 +
293 --
294 Enables highlighting of all break points for a loop or block context while hovering your mouse above any `async` or `await` keywords.
295 --
296 [[rust-analyzer.highlighting.strings]]rust-analyzer.highlighting.strings (default: `true`)::
297 +
298 --
299 Use semantic tokens for strings.
300
301 In some editors (e.g. vscode) semantic tokens override other highlighting grammars.
302 By disabling semantic tokens for strings, other grammars can be used to highlight
303 their contents.
304 --
305 [[rust-analyzer.hover.documentation]]rust-analyzer.hover.documentation (default: `true`)::
306 +
307 --
308 Whether to show documentation on hover.
309 --
310 [[rust-analyzer.hover.linksInHover]]rust-analyzer.hover.linksInHover (default: `true`)::
311 +
312 --
313 Use markdown syntax for links in hover.
314 --
315 [[rust-analyzer.hoverActions.debug]]rust-analyzer.hoverActions.debug (default: `true`)::
316 +
317 --
318 Whether to show `Debug` action. Only applies when
319 `#rust-analyzer.hoverActions.enable#` is set.
320 --
321 [[rust-analyzer.hoverActions.enable]]rust-analyzer.hoverActions.enable (default: `true`)::
322 +
323 --
324 Whether to show HoverActions in Rust files.
325 --
326 [[rust-analyzer.hoverActions.gotoTypeDef]]rust-analyzer.hoverActions.gotoTypeDef (default: `true`)::
327 +
328 --
329 Whether to show `Go to Type Definition` action. Only applies when
330 `#rust-analyzer.hoverActions.enable#` is set.
331 --
332 [[rust-analyzer.hoverActions.implementations]]rust-analyzer.hoverActions.implementations (default: `true`)::
333 +
334 --
335 Whether to show `Implementations` action. Only applies when
336 `#rust-analyzer.hoverActions.enable#` is set.
337 --
338 [[rust-analyzer.hoverActions.references]]rust-analyzer.hoverActions.references (default: `false`)::
339 +
340 --
341 Whether to show `References` action. Only applies when
342 `#rust-analyzer.hoverActions.enable#` is set.
343 --
344 [[rust-analyzer.hoverActions.run]]rust-analyzer.hoverActions.run (default: `true`)::
345 +
346 --
347 Whether to show `Run` action. Only applies when
348 `#rust-analyzer.hoverActions.enable#` is set.
349 --
350 [[rust-analyzer.inlayHints.renderColons]]rust-analyzer.inlayHints.renderColons (default: `true`)::
351 +
352 --
353 Whether to render trailing colons for parameter hints, and trailing colons for parameter hints.
354 --
355 [[rust-analyzer.inlayHints.maxLength]]rust-analyzer.inlayHints.maxLength (default: `25`)::
356 +
357 --
358 Maximum length for inlay hints. Set to null to have an unlimited length.
359 --
360 [[rust-analyzer.inlayHints.parameterHints]]rust-analyzer.inlayHints.parameterHints (default: `true`)::
361 +
362 --
363 Whether to show function parameter name inlay hints at the call
364 site.
365 --
366 [[rust-analyzer.inlayHints.typeHints]]rust-analyzer.inlayHints.typeHints (default: `true`)::
367 +
368 --
369 Whether to show inlay type hints for variables.
370 --
371 [[rust-analyzer.inlayHints.chainingHints]]rust-analyzer.inlayHints.chainingHints (default: `true`)::
372 +
373 --
374 Whether to show inlay type hints for method chains.
375 --
376 [[rust-analyzer.inlayHints.closureReturnTypeHints]]rust-analyzer.inlayHints.closureReturnTypeHints (default: `false`)::
377 +
378 --
379 Whether to show inlay type hints for return types of closures with blocks.
380 --
381 [[rust-analyzer.inlayHints.reborrowHints]]rust-analyzer.inlayHints.reborrowHints (default: `false`)::
382 +
383 --
384 Whether to show inlay type hints for compiler inserted reborrows.
385 --
386 [[rust-analyzer.inlayHints.lifetimeElisionHints.enable]]rust-analyzer.inlayHints.lifetimeElisionHints.enable (default: `"never"`)::
387 +
388 --
389 Whether to show inlay type hints for elided lifetimes in function signatures.
390 --
391 [[rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames]]rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames (default: `false`)::
392 +
393 --
394 Whether to prefer using parameter names as the name for elided lifetime hints if possible.
395 --
396 [[rust-analyzer.inlayHints.hideNamedConstructorHints]]rust-analyzer.inlayHints.hideNamedConstructorHints (default: `false`)::
397 +
398 --
399 Whether to hide inlay hints for constructors.
400 --
401 [[rust-analyzer.joinLines.joinElseIf]]rust-analyzer.joinLines.joinElseIf (default: `true`)::
402 +
403 --
404 Join lines inserts else between consecutive ifs.
405 --
406 [[rust-analyzer.joinLines.removeTrailingComma]]rust-analyzer.joinLines.removeTrailingComma (default: `true`)::
407 +
408 --
409 Join lines removes trailing commas.
410 --
411 [[rust-analyzer.joinLines.unwrapTrivialBlock]]rust-analyzer.joinLines.unwrapTrivialBlock (default: `true`)::
412 +
413 --
414 Join lines unwraps trivial blocks.
415 --
416 [[rust-analyzer.joinLines.joinAssignments]]rust-analyzer.joinLines.joinAssignments (default: `true`)::
417 +
418 --
419 Join lines merges consecutive declaration and initialization of an assignment.
420 --
421 [[rust-analyzer.lens.debug]]rust-analyzer.lens.debug (default: `true`)::
422 +
423 --
424 Whether to show `Debug` lens. Only applies when
425 `#rust-analyzer.lens.enable#` is set.
426 --
427 [[rust-analyzer.lens.enable]]rust-analyzer.lens.enable (default: `true`)::
428 +
429 --
430 Whether to show CodeLens in Rust files.
431 --
432 [[rust-analyzer.lens.implementations]]rust-analyzer.lens.implementations (default: `true`)::
433 +
434 --
435 Whether to show `Implementations` lens. Only applies when
436 `#rust-analyzer.lens.enable#` is set.
437 --
438 [[rust-analyzer.lens.run]]rust-analyzer.lens.run (default: `true`)::
439 +
440 --
441 Whether to show `Run` lens. Only applies when
442 `#rust-analyzer.lens.enable#` is set.
443 --
444 [[rust-analyzer.lens.methodReferences]]rust-analyzer.lens.methodReferences (default: `false`)::
445 +
446 --
447 Whether to show `Method References` lens. Only applies when
448 `#rust-analyzer.lens.enable#` is set.
449 --
450 [[rust-analyzer.lens.references]]rust-analyzer.lens.references (default: `false`)::
451 +
452 --
453 Whether to show `References` lens for Struct, Enum, Union and Trait.
454 Only applies when `#rust-analyzer.lens.enable#` is set.
455 --
456 [[rust-analyzer.lens.enumVariantReferences]]rust-analyzer.lens.enumVariantReferences (default: `false`)::
457 +
458 --
459 Whether to show `References` lens for Enum Variants.
460 Only applies when `#rust-analyzer.lens.enable#` is set.
461 --
462 [[rust-analyzer.lens.forceCustomCommands]]rust-analyzer.lens.forceCustomCommands (default: `true`)::
463 +
464 --
465 Internal config: use custom client-side commands even when the
466 client doesn't set the corresponding capability.
467 --
468 [[rust-analyzer.linkedProjects]]rust-analyzer.linkedProjects (default: `[]`)::
469 +
470 --
471 Disable project auto-discovery in favor of explicitly specified set
472 of projects.
473
474 Elements must be paths pointing to `Cargo.toml`,
475 `rust-project.json`, or JSON objects in `rust-project.json` format.
476 --
477 [[rust-analyzer.lruCapacity]]rust-analyzer.lruCapacity (default: `null`)::
478 +
479 --
480 Number of syntax trees rust-analyzer keeps in memory. Defaults to 128.
481 --
482 [[rust-analyzer.notifications.cargoTomlNotFound]]rust-analyzer.notifications.cargoTomlNotFound (default: `true`)::
483 +
484 --
485 Whether to show `can't find Cargo.toml` error message.
486 --
487 [[rust-analyzer.primeCaches.numThreads]]rust-analyzer.primeCaches.numThreads (default: `0`)::
488 +
489 --
490 How many worker threads to to handle priming caches. The default `0` means to pick automatically.
491 --
492 [[rust-analyzer.procMacro.enable]]rust-analyzer.procMacro.enable (default: `true`)::
493 +
494 --
495 Enable support for procedural macros, implies `#rust-analyzer.cargo.runBuildScripts#`.
496 --
497 [[rust-analyzer.procMacro.server]]rust-analyzer.procMacro.server (default: `null`)::
498 +
499 --
500 Internal config, path to proc-macro server executable (typically,
501 this is rust-analyzer itself, but we override this in tests).
502 --
503 [[rust-analyzer.procMacro.ignored]]rust-analyzer.procMacro.ignored (default: `{}`)::
504 +
505 --
506 These proc-macros will be ignored when trying to expand them.
507
508 This config takes a map of crate names with the exported proc-macro names to ignore as values.
509 --
510 [[rust-analyzer.runnables.overrideCargo]]rust-analyzer.runnables.overrideCargo (default: `null`)::
511 +
512 --
513 Command to be executed instead of 'cargo' for runnables.
514 --
515 [[rust-analyzer.runnables.cargoExtraArgs]]rust-analyzer.runnables.cargoExtraArgs (default: `[]`)::
516 +
517 --
518 Additional arguments to be passed to cargo for runnables such as
519 tests or binaries. For example, it may be `--release`.
520 --
521 [[rust-analyzer.rustcSource]]rust-analyzer.rustcSource (default: `null`)::
522 +
523 --
524 Path to the Cargo.toml of the rust compiler workspace, for usage in rustc_private
525 projects, or "discover" to try to automatically find it if the `rustc-dev` component
526 is installed.
527
528 Any project which uses rust-analyzer with the rustcPrivate
529 crates must set `[package.metadata.rust-analyzer] rustc_private=true` to use it.
530
531 This option does not take effect until rust-analyzer is restarted.
532 --
533 [[rust-analyzer.rustfmt.extraArgs]]rust-analyzer.rustfmt.extraArgs (default: `[]`)::
534 +
535 --
536 Additional arguments to `rustfmt`.
537 --
538 [[rust-analyzer.rustfmt.overrideCommand]]rust-analyzer.rustfmt.overrideCommand (default: `null`)::
539 +
540 --
541 Advanced option, fully override the command rust-analyzer uses for
542 formatting.
543 --
544 [[rust-analyzer.rustfmt.enableRangeFormatting]]rust-analyzer.rustfmt.enableRangeFormatting (default: `false`)::
545 +
546 --
547 Enables the use of rustfmt's unstable range formatting command for the
548 `textDocument/rangeFormatting` request. The rustfmt option is unstable and only
549 available on a nightly build.
550 --
551 [[rust-analyzer.workspace.symbol.search.scope]]rust-analyzer.workspace.symbol.search.scope (default: `"workspace"`)::
552 +
553 --
554 Workspace symbol search scope.
555 --
556 [[rust-analyzer.workspace.symbol.search.kind]]rust-analyzer.workspace.symbol.search.kind (default: `"only_types"`)::
557 +
558 --
559 Workspace symbol search kind.
560 --