]> git.lizzy.rs Git - rust.git/blob - docs/user/generated_config.adoc
Merge #11686
[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.chainingHints]]rust-analyzer.inlayHints.chainingHints (default: `true`)::
356 +
357 --
358 Whether to show inlay type hints for method chains.
359 --
360 [[rust-analyzer.inlayHints.maxLength]]rust-analyzer.inlayHints.maxLength (default: `25`)::
361 +
362 --
363 Maximum length for inlay hints. Set to null to have an unlimited length.
364 --
365 [[rust-analyzer.inlayHints.parameterHints]]rust-analyzer.inlayHints.parameterHints (default: `true`)::
366 +
367 --
368 Whether to show function parameter name inlay hints at the call
369 site.
370 --
371 [[rust-analyzer.inlayHints.typeHints]]rust-analyzer.inlayHints.typeHints (default: `true`)::
372 +
373 --
374 Whether to show inlay type hints for variables.
375 --
376 [[rust-analyzer.inlayHints.hideNamedConstructorHints]]rust-analyzer.inlayHints.hideNamedConstructorHints (default: `false`)::
377 +
378 --
379 Whether to hide inlay hints for constructors.
380 --
381 [[rust-analyzer.joinLines.joinElseIf]]rust-analyzer.joinLines.joinElseIf (default: `true`)::
382 +
383 --
384 Join lines inserts else between consecutive ifs.
385 --
386 [[rust-analyzer.joinLines.removeTrailingComma]]rust-analyzer.joinLines.removeTrailingComma (default: `true`)::
387 +
388 --
389 Join lines removes trailing commas.
390 --
391 [[rust-analyzer.joinLines.unwrapTrivialBlock]]rust-analyzer.joinLines.unwrapTrivialBlock (default: `true`)::
392 +
393 --
394 Join lines unwraps trivial blocks.
395 --
396 [[rust-analyzer.joinLines.joinAssignments]]rust-analyzer.joinLines.joinAssignments (default: `true`)::
397 +
398 --
399 Join lines merges consecutive declaration and initialization of an assignment.
400 --
401 [[rust-analyzer.lens.debug]]rust-analyzer.lens.debug (default: `true`)::
402 +
403 --
404 Whether to show `Debug` lens. Only applies when
405 `#rust-analyzer.lens.enable#` is set.
406 --
407 [[rust-analyzer.lens.enable]]rust-analyzer.lens.enable (default: `true`)::
408 +
409 --
410 Whether to show CodeLens in Rust files.
411 --
412 [[rust-analyzer.lens.implementations]]rust-analyzer.lens.implementations (default: `true`)::
413 +
414 --
415 Whether to show `Implementations` lens. Only applies when
416 `#rust-analyzer.lens.enable#` is set.
417 --
418 [[rust-analyzer.lens.run]]rust-analyzer.lens.run (default: `true`)::
419 +
420 --
421 Whether to show `Run` lens. Only applies when
422 `#rust-analyzer.lens.enable#` is set.
423 --
424 [[rust-analyzer.lens.methodReferences]]rust-analyzer.lens.methodReferences (default: `false`)::
425 +
426 --
427 Whether to show `Method References` lens. Only applies when
428 `#rust-analyzer.lens.enable#` is set.
429 --
430 [[rust-analyzer.lens.references]]rust-analyzer.lens.references (default: `false`)::
431 +
432 --
433 Whether to show `References` lens for Struct, Enum, Union and Trait.
434 Only applies when `#rust-analyzer.lens.enable#` is set.
435 --
436 [[rust-analyzer.lens.enumVariantReferences]]rust-analyzer.lens.enumVariantReferences (default: `false`)::
437 +
438 --
439 Whether to show `References` lens for Enum Variants.
440 Only applies when `#rust-analyzer.lens.enable#` is set.
441 --
442 [[rust-analyzer.lens.forceCustomCommands]]rust-analyzer.lens.forceCustomCommands (default: `true`)::
443 +
444 --
445 Internal config: use custom client-side commands even when the
446 client doesn't set the corresponding capability.
447 --
448 [[rust-analyzer.linkedProjects]]rust-analyzer.linkedProjects (default: `[]`)::
449 +
450 --
451 Disable project auto-discovery in favor of explicitly specified set
452 of projects.
453
454 Elements must be paths pointing to `Cargo.toml`,
455 `rust-project.json`, or JSON objects in `rust-project.json` format.
456 --
457 [[rust-analyzer.lruCapacity]]rust-analyzer.lruCapacity (default: `null`)::
458 +
459 --
460 Number of syntax trees rust-analyzer keeps in memory. Defaults to 128.
461 --
462 [[rust-analyzer.notifications.cargoTomlNotFound]]rust-analyzer.notifications.cargoTomlNotFound (default: `true`)::
463 +
464 --
465 Whether to show `can't find Cargo.toml` error message.
466 --
467 [[rust-analyzer.primeCaches.numThreads]]rust-analyzer.primeCaches.numThreads (default: `0`)::
468 +
469 --
470 How many worker threads to to handle priming caches. The default `0` means to pick automatically.
471 --
472 [[rust-analyzer.procMacro.enable]]rust-analyzer.procMacro.enable (default: `true`)::
473 +
474 --
475 Enable support for procedural macros, implies `#rust-analyzer.cargo.runBuildScripts#`.
476 --
477 [[rust-analyzer.procMacro.server]]rust-analyzer.procMacro.server (default: `null`)::
478 +
479 --
480 Internal config, path to proc-macro server executable (typically,
481 this is rust-analyzer itself, but we override this in tests).
482 --
483 [[rust-analyzer.procMacro.ignored]]rust-analyzer.procMacro.ignored (default: `{}`)::
484 +
485 --
486 These proc-macros will be ignored when trying to expand them.
487
488 This config takes a map of crate names with the exported proc-macro names to ignore as values.
489 --
490 [[rust-analyzer.runnables.overrideCargo]]rust-analyzer.runnables.overrideCargo (default: `null`)::
491 +
492 --
493 Command to be executed instead of 'cargo' for runnables.
494 --
495 [[rust-analyzer.runnables.cargoExtraArgs]]rust-analyzer.runnables.cargoExtraArgs (default: `[]`)::
496 +
497 --
498 Additional arguments to be passed to cargo for runnables such as
499 tests or binaries. For example, it may be `--release`.
500 --
501 [[rust-analyzer.rustcSource]]rust-analyzer.rustcSource (default: `null`)::
502 +
503 --
504 Path to the Cargo.toml of the rust compiler workspace, for usage in rustc_private
505 projects, or "discover" to try to automatically find it if the `rustc-dev` component
506 is installed.
507
508 Any project which uses rust-analyzer with the rustcPrivate
509 crates must set `[package.metadata.rust-analyzer] rustc_private=true` to use it.
510
511 This option does not take effect until rust-analyzer is restarted.
512 --
513 [[rust-analyzer.rustfmt.extraArgs]]rust-analyzer.rustfmt.extraArgs (default: `[]`)::
514 +
515 --
516 Additional arguments to `rustfmt`.
517 --
518 [[rust-analyzer.rustfmt.overrideCommand]]rust-analyzer.rustfmt.overrideCommand (default: `null`)::
519 +
520 --
521 Advanced option, fully override the command rust-analyzer uses for
522 formatting.
523 --
524 [[rust-analyzer.rustfmt.enableRangeFormatting]]rust-analyzer.rustfmt.enableRangeFormatting (default: `false`)::
525 +
526 --
527 Enables the use of rustfmt's unstable range formatting command for the
528 `textDocument/rangeFormatting` request. The rustfmt option is unstable and only
529 available on a nightly build.
530 --
531 [[rust-analyzer.workspace.symbol.search.scope]]rust-analyzer.workspace.symbol.search.scope (default: `"workspace"`)::
532 +
533 --
534 Workspace symbol search scope.
535 --
536 [[rust-analyzer.workspace.symbol.search.kind]]rust-analyzer.workspace.symbol.search.kind (default: `"only_types"`)::
537 +
538 --
539 Workspace symbol search kind.
540 --