]> git.lizzy.rs Git - rust.git/blob - docs/user/generated_config.adoc
Merge #11516
[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.diagnostics.enable]]rust-analyzer.diagnostics.enable (default: `true`)::
217 +
218 --
219 Whether to show native rust-analyzer diagnostics.
220 --
221 [[rust-analyzer.diagnostics.enableExperimental]]rust-analyzer.diagnostics.enableExperimental (default: `true`)::
222 +
223 --
224 Whether to show experimental rust-analyzer diagnostics that might
225 have more false positives than usual.
226 --
227 [[rust-analyzer.diagnostics.disabled]]rust-analyzer.diagnostics.disabled (default: `[]`)::
228 +
229 --
230 List of rust-analyzer diagnostics to disable.
231 --
232 [[rust-analyzer.diagnostics.remapPrefix]]rust-analyzer.diagnostics.remapPrefix (default: `{}`)::
233 +
234 --
235 Map of prefixes to be substituted when parsing diagnostic file paths.
236 This should be the reverse mapping of what is passed to `rustc` as `--remap-path-prefix`.
237 --
238 [[rust-analyzer.diagnostics.warningsAsHint]]rust-analyzer.diagnostics.warningsAsHint (default: `[]`)::
239 +
240 --
241 List of warnings that should be displayed with hint severity.
242
243 The warnings will be indicated by faded text or three dots in code
244 and will not show up in the `Problems Panel`.
245 --
246 [[rust-analyzer.diagnostics.warningsAsInfo]]rust-analyzer.diagnostics.warningsAsInfo (default: `[]`)::
247 +
248 --
249 List of warnings that should be displayed with info severity.
250
251 The warnings will be indicated by a blue squiggly underline in code
252 and a blue icon in the `Problems Panel`.
253 --
254 [[rust-analyzer.experimental.procAttrMacros]]rust-analyzer.experimental.procAttrMacros (default: `true`)::
255 +
256 --
257 Expand attribute macros.
258 --
259 [[rust-analyzer.files.watcher]]rust-analyzer.files.watcher (default: `"client"`)::
260 +
261 --
262 Controls file watching implementation.
263 --
264 [[rust-analyzer.files.excludeDirs]]rust-analyzer.files.excludeDirs (default: `[]`)::
265 +
266 --
267 These directories will be ignored by rust-analyzer. They are
268 relative to the workspace root, and globs are not supported. You may
269 also need to add the folders to Code's `files.watcherExclude`.
270 --
271 [[rust-analyzer.highlightRelated.references]]rust-analyzer.highlightRelated.references (default: `true`)::
272 +
273 --
274 Enables highlighting of related references while hovering your mouse above any identifier.
275 --
276 [[rust-analyzer.highlightRelated.exitPoints]]rust-analyzer.highlightRelated.exitPoints (default: `true`)::
277 +
278 --
279 Enables highlighting of all exit points while hovering your mouse above any `return`, `?`, or return type arrow (`->`).
280 --
281 [[rust-analyzer.highlightRelated.breakPoints]]rust-analyzer.highlightRelated.breakPoints (default: `true`)::
282 +
283 --
284 Enables highlighting of related references while hovering your mouse `break`, `loop`, `while`, or `for` keywords.
285 --
286 [[rust-analyzer.highlightRelated.yieldPoints]]rust-analyzer.highlightRelated.yieldPoints (default: `true`)::
287 +
288 --
289 Enables highlighting of all break points for a loop or block context while hovering your mouse above any `async` or `await` keywords.
290 --
291 [[rust-analyzer.highlighting.strings]]rust-analyzer.highlighting.strings (default: `true`)::
292 +
293 --
294 Use semantic tokens for strings.
295
296 In some editors (e.g. vscode) semantic tokens override other highlighting grammars.
297 By disabling semantic tokens for strings, other grammars can be used to highlight
298 their contents.
299 --
300 [[rust-analyzer.hover.documentation]]rust-analyzer.hover.documentation (default: `true`)::
301 +
302 --
303 Whether to show documentation on hover.
304 --
305 [[rust-analyzer.hover.linksInHover]]rust-analyzer.hover.linksInHover (default: `true`)::
306 +
307 --
308 Use markdown syntax for links in hover.
309 --
310 [[rust-analyzer.hoverActions.debug]]rust-analyzer.hoverActions.debug (default: `true`)::
311 +
312 --
313 Whether to show `Debug` action. Only applies when
314 `#rust-analyzer.hoverActions.enable#` is set.
315 --
316 [[rust-analyzer.hoverActions.enable]]rust-analyzer.hoverActions.enable (default: `true`)::
317 +
318 --
319 Whether to show HoverActions in Rust files.
320 --
321 [[rust-analyzer.hoverActions.gotoTypeDef]]rust-analyzer.hoverActions.gotoTypeDef (default: `true`)::
322 +
323 --
324 Whether to show `Go to Type Definition` action. Only applies when
325 `#rust-analyzer.hoverActions.enable#` is set.
326 --
327 [[rust-analyzer.hoverActions.implementations]]rust-analyzer.hoverActions.implementations (default: `true`)::
328 +
329 --
330 Whether to show `Implementations` action. Only applies when
331 `#rust-analyzer.hoverActions.enable#` is set.
332 --
333 [[rust-analyzer.hoverActions.references]]rust-analyzer.hoverActions.references (default: `false`)::
334 +
335 --
336 Whether to show `References` action. Only applies when
337 `#rust-analyzer.hoverActions.enable#` is set.
338 --
339 [[rust-analyzer.hoverActions.run]]rust-analyzer.hoverActions.run (default: `true`)::
340 +
341 --
342 Whether to show `Run` action. Only applies when
343 `#rust-analyzer.hoverActions.enable#` is set.
344 --
345 [[rust-analyzer.inlayHints.chainingHints]]rust-analyzer.inlayHints.chainingHints (default: `true`)::
346 +
347 --
348 Whether to show inlay type hints for method chains.
349 --
350 [[rust-analyzer.inlayHints.maxLength]]rust-analyzer.inlayHints.maxLength (default: `25`)::
351 +
352 --
353 Maximum length for inlay hints. Set to null to have an unlimited length.
354 --
355 [[rust-analyzer.inlayHints.parameterHints]]rust-analyzer.inlayHints.parameterHints (default: `true`)::
356 +
357 --
358 Whether to show function parameter name inlay hints at the call
359 site.
360 --
361 [[rust-analyzer.inlayHints.typeHints]]rust-analyzer.inlayHints.typeHints (default: `true`)::
362 +
363 --
364 Whether to show inlay type hints for variables.
365 --
366 [[rust-analyzer.inlayHints.hideNamedConstructorHints]]rust-analyzer.inlayHints.hideNamedConstructorHints (default: `false`)::
367 +
368 --
369 Whether to hide inlay hints for constructors.
370 --
371 [[rust-analyzer.joinLines.joinElseIf]]rust-analyzer.joinLines.joinElseIf (default: `true`)::
372 +
373 --
374 Join lines inserts else between consecutive ifs.
375 --
376 [[rust-analyzer.joinLines.removeTrailingComma]]rust-analyzer.joinLines.removeTrailingComma (default: `true`)::
377 +
378 --
379 Join lines removes trailing commas.
380 --
381 [[rust-analyzer.joinLines.unwrapTrivialBlock]]rust-analyzer.joinLines.unwrapTrivialBlock (default: `true`)::
382 +
383 --
384 Join lines unwraps trivial blocks.
385 --
386 [[rust-analyzer.joinLines.joinAssignments]]rust-analyzer.joinLines.joinAssignments (default: `true`)::
387 +
388 --
389 Join lines merges consecutive declaration and initialization of an assignment.
390 --
391 [[rust-analyzer.lens.debug]]rust-analyzer.lens.debug (default: `true`)::
392 +
393 --
394 Whether to show `Debug` lens. Only applies when
395 `#rust-analyzer.lens.enable#` is set.
396 --
397 [[rust-analyzer.lens.enable]]rust-analyzer.lens.enable (default: `true`)::
398 +
399 --
400 Whether to show CodeLens in Rust files.
401 --
402 [[rust-analyzer.lens.implementations]]rust-analyzer.lens.implementations (default: `true`)::
403 +
404 --
405 Whether to show `Implementations` lens. Only applies when
406 `#rust-analyzer.lens.enable#` is set.
407 --
408 [[rust-analyzer.lens.run]]rust-analyzer.lens.run (default: `true`)::
409 +
410 --
411 Whether to show `Run` lens. Only applies when
412 `#rust-analyzer.lens.enable#` is set.
413 --
414 [[rust-analyzer.lens.methodReferences]]rust-analyzer.lens.methodReferences (default: `false`)::
415 +
416 --
417 Whether to show `Method References` lens. Only applies when
418 `#rust-analyzer.lens.enable#` is set.
419 --
420 [[rust-analyzer.lens.references]]rust-analyzer.lens.references (default: `false`)::
421 +
422 --
423 Whether to show `References` lens for Struct, Enum, Union and Trait.
424 Only applies when `#rust-analyzer.lens.enable#` is set.
425 --
426 [[rust-analyzer.lens.enumVariantReferences]]rust-analyzer.lens.enumVariantReferences (default: `false`)::
427 +
428 --
429 Whether to show `References` lens for Enum Variants.
430 Only applies when `#rust-analyzer.lens.enable#` is set.
431 --
432 [[rust-analyzer.lens.forceCustomCommands]]rust-analyzer.lens.forceCustomCommands (default: `true`)::
433 +
434 --
435 Internal config: use custom client-side commands even when the
436 client doesn't set the corresponding capability.
437 --
438 [[rust-analyzer.linkedProjects]]rust-analyzer.linkedProjects (default: `[]`)::
439 +
440 --
441 Disable project auto-discovery in favor of explicitly specified set
442 of projects.
443
444 Elements must be paths pointing to `Cargo.toml`,
445 `rust-project.json`, or JSON objects in `rust-project.json` format.
446 --
447 [[rust-analyzer.lruCapacity]]rust-analyzer.lruCapacity (default: `null`)::
448 +
449 --
450 Number of syntax trees rust-analyzer keeps in memory. Defaults to 128.
451 --
452 [[rust-analyzer.notifications.cargoTomlNotFound]]rust-analyzer.notifications.cargoTomlNotFound (default: `true`)::
453 +
454 --
455 Whether to show `can't find Cargo.toml` error message.
456 --
457 [[rust-analyzer.primeCaches.numThreads]]rust-analyzer.primeCaches.numThreads (default: `0`)::
458 +
459 --
460 How many worker threads to to handle priming caches. The default `0` means to pick automatically.
461 --
462 [[rust-analyzer.procMacro.enable]]rust-analyzer.procMacro.enable (default: `true`)::
463 +
464 --
465 Enable support for procedural macros, implies `#rust-analyzer.cargo.runBuildScripts#`.
466 --
467 [[rust-analyzer.procMacro.server]]rust-analyzer.procMacro.server (default: `null`)::
468 +
469 --
470 Internal config, path to proc-macro server executable (typically,
471 this is rust-analyzer itself, but we override this in tests).
472 --
473 [[rust-analyzer.procMacro.ignored]]rust-analyzer.procMacro.ignored (default: `{}`)::
474 +
475 --
476 These proc-macros will be ignored when trying to expand them.
477
478 This config takes a map of crate names with the exported proc-macro names to ignore as values.
479 --
480 [[rust-analyzer.runnables.overrideCargo]]rust-analyzer.runnables.overrideCargo (default: `null`)::
481 +
482 --
483 Command to be executed instead of 'cargo' for runnables.
484 --
485 [[rust-analyzer.runnables.cargoExtraArgs]]rust-analyzer.runnables.cargoExtraArgs (default: `[]`)::
486 +
487 --
488 Additional arguments to be passed to cargo for runnables such as
489 tests or binaries. For example, it may be `--release`.
490 --
491 [[rust-analyzer.rustcSource]]rust-analyzer.rustcSource (default: `null`)::
492 +
493 --
494 Path to the Cargo.toml of the rust compiler workspace, for usage in rustc_private
495 projects, or "discover" to try to automatically find it if the `rustc-dev` component
496 is installed.
497
498 Any project which uses rust-analyzer with the rustcPrivate
499 crates must set `[package.metadata.rust-analyzer] rustc_private=true` to use it.
500
501 This option does not take effect until rust-analyzer is restarted.
502 --
503 [[rust-analyzer.rustfmt.extraArgs]]rust-analyzer.rustfmt.extraArgs (default: `[]`)::
504 +
505 --
506 Additional arguments to `rustfmt`.
507 --
508 [[rust-analyzer.rustfmt.overrideCommand]]rust-analyzer.rustfmt.overrideCommand (default: `null`)::
509 +
510 --
511 Advanced option, fully override the command rust-analyzer uses for
512 formatting.
513 --
514 [[rust-analyzer.rustfmt.enableRangeFormatting]]rust-analyzer.rustfmt.enableRangeFormatting (default: `false`)::
515 +
516 --
517 Enables the use of rustfmt's unstable range formatting command for the
518 `textDocument/rangeFormatting` request. The rustfmt option is unstable and only
519 available on a nightly build.
520 --
521 [[rust-analyzer.workspace.symbol.search.scope]]rust-analyzer.workspace.symbol.search.scope (default: `"workspace"`)::
522 +
523 --
524 Workspace symbol search scope.
525 --
526 [[rust-analyzer.workspace.symbol.search.kind]]rust-analyzer.workspace.symbol.search.kind (default: `"only_types"`)::
527 +
528 --
529 Workspace symbol search kind.
530 --