]> git.lizzy.rs Git - rust.git/blob - src/tools/rust-analyzer/docs/user/generated_config.adoc
:arrow_up: rust-analyzer
[rust.git] / src / tools / rust-analyzer / docs / user / generated_config.adoc
1 [[rust-analyzer.assist.emitMustUse]]rust-analyzer.assist.emitMustUse (default: `false`)::
2 +
3 --
4 Whether to insert #[must_use] when generating `as_` methods
5 for enum variants.
6 --
7 [[rust-analyzer.assist.expressionFillDefault]]rust-analyzer.assist.expressionFillDefault (default: `"todo"`)::
8 +
9 --
10 Placeholder expression to use for missing expressions in assists.
11 --
12 [[rust-analyzer.cachePriming.enable]]rust-analyzer.cachePriming.enable (default: `true`)::
13 +
14 --
15 Warm up caches on project load.
16 --
17 [[rust-analyzer.cachePriming.numThreads]]rust-analyzer.cachePriming.numThreads (default: `0`)::
18 +
19 --
20 How many worker threads to handle priming caches. The default `0` means to pick automatically.
21 --
22 [[rust-analyzer.cargo.autoreload]]rust-analyzer.cargo.autoreload (default: `true`)::
23 +
24 --
25 Automatically refresh project info via `cargo metadata` on
26 `Cargo.toml` or `.cargo/config.toml` changes.
27 --
28 [[rust-analyzer.cargo.buildScripts.enable]]rust-analyzer.cargo.buildScripts.enable (default: `true`)::
29 +
30 --
31 Run build scripts (`build.rs`) for more precise code analysis.
32 --
33 [[rust-analyzer.cargo.buildScripts.invocationLocation]]rust-analyzer.cargo.buildScripts.invocationLocation (default: `"workspace"`)::
34 +
35 --
36 Specifies the working directory for running build scripts.
37 - "workspace": run build scripts for a workspace in the workspace's root directory.
38   This is incompatible with `#rust-analyzer.cargo.buildScripts.invocationStrategy#` set to `once`.
39 - "root": run build scripts in the project's root directory.
40 This config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`
41 is set.
42 --
43 [[rust-analyzer.cargo.buildScripts.invocationStrategy]]rust-analyzer.cargo.buildScripts.invocationStrategy (default: `"per_workspace"`)::
44 +
45 --
46 Specifies the invocation strategy to use when running the build scripts command.
47 If `per_workspace` is set, the command will be executed for each workspace.
48 If `once` is set, the command will be executed once.
49 This config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`
50 is set.
51 --
52 [[rust-analyzer.cargo.buildScripts.overrideCommand]]rust-analyzer.cargo.buildScripts.overrideCommand (default: `null`)::
53 +
54 --
55 Override the command rust-analyzer uses to run build scripts and
56 build procedural macros. The command is required to output json
57 and should therefore include `--message-format=json` or a similar
58 option.
59
60 By default, a cargo invocation will be constructed for the configured
61 targets and features, with the following base command line:
62
63 ```bash
64 cargo check --quiet --workspace --message-format=json --all-targets
65 ```
66 .
67 --
68 [[rust-analyzer.cargo.buildScripts.useRustcWrapper]]rust-analyzer.cargo.buildScripts.useRustcWrapper (default: `true`)::
69 +
70 --
71 Use `RUSTC_WRAPPER=rust-analyzer` when running build scripts to
72 avoid checking unnecessary things.
73 --
74 [[rust-analyzer.cargo.extraEnv]]rust-analyzer.cargo.extraEnv (default: `{}`)::
75 +
76 --
77 Extra environment variables that will be set when running cargo, rustc
78 or other commands within the workspace. Useful for setting RUSTFLAGS.
79 --
80 [[rust-analyzer.cargo.features]]rust-analyzer.cargo.features (default: `[]`)::
81 +
82 --
83 List of features to activate.
84
85 Set this to `"all"` to pass `--all-features` to cargo.
86 --
87 [[rust-analyzer.cargo.noDefaultFeatures]]rust-analyzer.cargo.noDefaultFeatures (default: `false`)::
88 +
89 --
90 Whether to pass `--no-default-features` to cargo.
91 --
92 [[rust-analyzer.cargo.sysroot]]rust-analyzer.cargo.sysroot (default: `"discover"`)::
93 +
94 --
95 Relative path to the sysroot, or "discover" to try to automatically find it via
96 "rustc --print sysroot".
97
98 Unsetting this disables sysroot loading.
99
100 This option does not take effect until rust-analyzer is restarted.
101 --
102 [[rust-analyzer.cargo.target]]rust-analyzer.cargo.target (default: `null`)::
103 +
104 --
105 Compilation target override (target triple).
106 --
107 [[rust-analyzer.cargo.unsetTest]]rust-analyzer.cargo.unsetTest (default: `["core"]`)::
108 +
109 --
110 Unsets `#[cfg(test)]` for the specified crates.
111 --
112 [[rust-analyzer.checkOnSave.allTargets]]rust-analyzer.checkOnSave.allTargets (default: `true`)::
113 +
114 --
115 Check all targets and tests (`--all-targets`).
116 --
117 [[rust-analyzer.checkOnSave.command]]rust-analyzer.checkOnSave.command (default: `"check"`)::
118 +
119 --
120 Cargo command to use for `cargo check`.
121 --
122 [[rust-analyzer.checkOnSave.enable]]rust-analyzer.checkOnSave.enable (default: `true`)::
123 +
124 --
125 Run specified `cargo check` command for diagnostics on save.
126 --
127 [[rust-analyzer.checkOnSave.extraArgs]]rust-analyzer.checkOnSave.extraArgs (default: `[]`)::
128 +
129 --
130 Extra arguments for `cargo check`.
131 --
132 [[rust-analyzer.checkOnSave.extraEnv]]rust-analyzer.checkOnSave.extraEnv (default: `{}`)::
133 +
134 --
135 Extra environment variables that will be set when running `cargo check`.
136 Extends `#rust-analyzer.cargo.extraEnv#`.
137 --
138 [[rust-analyzer.checkOnSave.features]]rust-analyzer.checkOnSave.features (default: `null`)::
139 +
140 --
141 List of features to activate. Defaults to
142 `#rust-analyzer.cargo.features#`.
143
144 Set to `"all"` to pass `--all-features` to Cargo.
145 --
146 [[rust-analyzer.checkOnSave.invocationLocation]]rust-analyzer.checkOnSave.invocationLocation (default: `"workspace"`)::
147 +
148 --
149 Specifies the working directory for running checks.
150 - "workspace": run checks for workspaces in the corresponding workspaces' root directories.
151   This falls back to "root" if `#rust-analyzer.cargo.checkOnSave.invocationStrategy#` is set to `once`.
152 - "root": run checks in the project's root directory.
153 This config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`
154 is set.
155 --
156 [[rust-analyzer.checkOnSave.invocationStrategy]]rust-analyzer.checkOnSave.invocationStrategy (default: `"per_workspace"`)::
157 +
158 --
159 Specifies the invocation strategy to use when running the checkOnSave command.
160 If `per_workspace` is set, the command will be executed for each workspace.
161 If `once` is set, the command will be executed once.
162 This config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`
163 is set.
164 --
165 [[rust-analyzer.checkOnSave.noDefaultFeatures]]rust-analyzer.checkOnSave.noDefaultFeatures (default: `null`)::
166 +
167 --
168 Whether to pass `--no-default-features` to Cargo. Defaults to
169 `#rust-analyzer.cargo.noDefaultFeatures#`.
170 --
171 [[rust-analyzer.checkOnSave.overrideCommand]]rust-analyzer.checkOnSave.overrideCommand (default: `null`)::
172 +
173 --
174 Override the command rust-analyzer uses instead of `cargo check` for
175 diagnostics on save. The command is required to output json and
176 should therefore include `--message-format=json` or a similar option.
177
178 If you're changing this because you're using some tool wrapping
179 Cargo, you might also want to change
180 `#rust-analyzer.cargo.buildScripts.overrideCommand#`.
181
182 If there are multiple linked projects, this command is invoked for
183 each of them, with the working directory being the project root
184 (i.e., the folder containing the `Cargo.toml`).
185
186 An example command would be:
187
188 ```bash
189 cargo check --workspace --message-format=json --all-targets
190 ```
191 .
192 --
193 [[rust-analyzer.checkOnSave.target]]rust-analyzer.checkOnSave.target (default: `[]`)::
194 +
195 --
196 Check for specific targets. Defaults to `#rust-analyzer.cargo.target#` if empty.
197
198 Can be a single target, e.g. `"x86_64-unknown-linux-gnu"` or a list of targets, e.g.
199 `["aarch64-apple-darwin", "x86_64-apple-darwin"]`.
200
201 Aliased as `"checkOnSave.targets"`.
202 --
203 [[rust-analyzer.completion.autoimport.enable]]rust-analyzer.completion.autoimport.enable (default: `true`)::
204 +
205 --
206 Toggles the additional completions that automatically add imports when completed.
207 Note that your client must specify the `additionalTextEdits` LSP client capability to truly have this feature enabled.
208 --
209 [[rust-analyzer.completion.autoself.enable]]rust-analyzer.completion.autoself.enable (default: `true`)::
210 +
211 --
212 Toggles the additional completions that automatically show method calls and field accesses
213 with `self` prefixed to them when inside a method.
214 --
215 [[rust-analyzer.completion.callable.snippets]]rust-analyzer.completion.callable.snippets (default: `"fill_arguments"`)::
216 +
217 --
218 Whether to add parenthesis and argument snippets when completing function.
219 --
220 [[rust-analyzer.completion.postfix.enable]]rust-analyzer.completion.postfix.enable (default: `true`)::
221 +
222 --
223 Whether to show postfix snippets like `dbg`, `if`, `not`, etc.
224 --
225 [[rust-analyzer.completion.privateEditable.enable]]rust-analyzer.completion.privateEditable.enable (default: `false`)::
226 +
227 --
228 Enables completions of private items and fields that are defined in the current workspace even if they are not visible at the current position.
229 --
230 [[rust-analyzer.completion.snippets.custom]]rust-analyzer.completion.snippets.custom::
231 +
232 --
233 Default:
234 ----
235 {
236             "Arc::new": {
237                 "postfix": "arc",
238                 "body": "Arc::new(${receiver})",
239                 "requires": "std::sync::Arc",
240                 "description": "Put the expression into an `Arc`",
241                 "scope": "expr"
242             },
243             "Rc::new": {
244                 "postfix": "rc",
245                 "body": "Rc::new(${receiver})",
246                 "requires": "std::rc::Rc",
247                 "description": "Put the expression into an `Rc`",
248                 "scope": "expr"
249             },
250             "Box::pin": {
251                 "postfix": "pinbox",
252                 "body": "Box::pin(${receiver})",
253                 "requires": "std::boxed::Box",
254                 "description": "Put the expression into a pinned `Box`",
255                 "scope": "expr"
256             },
257             "Ok": {
258                 "postfix": "ok",
259                 "body": "Ok(${receiver})",
260                 "description": "Wrap the expression in a `Result::Ok`",
261                 "scope": "expr"
262             },
263             "Err": {
264                 "postfix": "err",
265                 "body": "Err(${receiver})",
266                 "description": "Wrap the expression in a `Result::Err`",
267                 "scope": "expr"
268             },
269             "Some": {
270                 "postfix": "some",
271                 "body": "Some(${receiver})",
272                 "description": "Wrap the expression in an `Option::Some`",
273                 "scope": "expr"
274             }
275         }
276 ----
277 Custom completion snippets.
278
279 --
280 [[rust-analyzer.diagnostics.disabled]]rust-analyzer.diagnostics.disabled (default: `[]`)::
281 +
282 --
283 List of rust-analyzer diagnostics to disable.
284 --
285 [[rust-analyzer.diagnostics.enable]]rust-analyzer.diagnostics.enable (default: `true`)::
286 +
287 --
288 Whether to show native rust-analyzer diagnostics.
289 --
290 [[rust-analyzer.diagnostics.experimental.enable]]rust-analyzer.diagnostics.experimental.enable (default: `false`)::
291 +
292 --
293 Whether to show experimental rust-analyzer diagnostics that might
294 have more false positives than usual.
295 --
296 [[rust-analyzer.diagnostics.remapPrefix]]rust-analyzer.diagnostics.remapPrefix (default: `{}`)::
297 +
298 --
299 Map of prefixes to be substituted when parsing diagnostic file paths.
300 This should be the reverse mapping of what is passed to `rustc` as `--remap-path-prefix`.
301 --
302 [[rust-analyzer.diagnostics.warningsAsHint]]rust-analyzer.diagnostics.warningsAsHint (default: `[]`)::
303 +
304 --
305 List of warnings that should be displayed with hint severity.
306
307 The warnings will be indicated by faded text or three dots in code
308 and will not show up in the `Problems Panel`.
309 --
310 [[rust-analyzer.diagnostics.warningsAsInfo]]rust-analyzer.diagnostics.warningsAsInfo (default: `[]`)::
311 +
312 --
313 List of warnings that should be displayed with info severity.
314
315 The warnings will be indicated by a blue squiggly underline in code
316 and a blue icon in the `Problems Panel`.
317 --
318 [[rust-analyzer.files.excludeDirs]]rust-analyzer.files.excludeDirs (default: `[]`)::
319 +
320 --
321 These directories will be ignored by rust-analyzer. They are
322 relative to the workspace root, and globs are not supported. You may
323 also need to add the folders to Code's `files.watcherExclude`.
324 --
325 [[rust-analyzer.files.watcher]]rust-analyzer.files.watcher (default: `"client"`)::
326 +
327 --
328 Controls file watching implementation.
329 --
330 [[rust-analyzer.highlightRelated.breakPoints.enable]]rust-analyzer.highlightRelated.breakPoints.enable (default: `true`)::
331 +
332 --
333 Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords.
334 --
335 [[rust-analyzer.highlightRelated.exitPoints.enable]]rust-analyzer.highlightRelated.exitPoints.enable (default: `true`)::
336 +
337 --
338 Enables highlighting of all exit points while the cursor is on any `return`, `?`, `fn`, or return type arrow (`->`).
339 --
340 [[rust-analyzer.highlightRelated.references.enable]]rust-analyzer.highlightRelated.references.enable (default: `true`)::
341 +
342 --
343 Enables highlighting of related references while the cursor is on any identifier.
344 --
345 [[rust-analyzer.highlightRelated.yieldPoints.enable]]rust-analyzer.highlightRelated.yieldPoints.enable (default: `true`)::
346 +
347 --
348 Enables highlighting of all break points for a loop or block context while the cursor is on any `async` or `await` keywords.
349 --
350 [[rust-analyzer.hover.actions.debug.enable]]rust-analyzer.hover.actions.debug.enable (default: `true`)::
351 +
352 --
353 Whether to show `Debug` action. Only applies when
354 `#rust-analyzer.hover.actions.enable#` is set.
355 --
356 [[rust-analyzer.hover.actions.enable]]rust-analyzer.hover.actions.enable (default: `true`)::
357 +
358 --
359 Whether to show HoverActions in Rust files.
360 --
361 [[rust-analyzer.hover.actions.gotoTypeDef.enable]]rust-analyzer.hover.actions.gotoTypeDef.enable (default: `true`)::
362 +
363 --
364 Whether to show `Go to Type Definition` action. Only applies when
365 `#rust-analyzer.hover.actions.enable#` is set.
366 --
367 [[rust-analyzer.hover.actions.implementations.enable]]rust-analyzer.hover.actions.implementations.enable (default: `true`)::
368 +
369 --
370 Whether to show `Implementations` action. Only applies when
371 `#rust-analyzer.hover.actions.enable#` is set.
372 --
373 [[rust-analyzer.hover.actions.references.enable]]rust-analyzer.hover.actions.references.enable (default: `false`)::
374 +
375 --
376 Whether to show `References` action. Only applies when
377 `#rust-analyzer.hover.actions.enable#` is set.
378 --
379 [[rust-analyzer.hover.actions.run.enable]]rust-analyzer.hover.actions.run.enable (default: `true`)::
380 +
381 --
382 Whether to show `Run` action. Only applies when
383 `#rust-analyzer.hover.actions.enable#` is set.
384 --
385 [[rust-analyzer.hover.documentation.enable]]rust-analyzer.hover.documentation.enable (default: `true`)::
386 +
387 --
388 Whether to show documentation on hover.
389 --
390 [[rust-analyzer.hover.documentation.keywords.enable]]rust-analyzer.hover.documentation.keywords.enable (default: `true`)::
391 +
392 --
393 Whether to show keyword hover popups. Only applies when
394 `#rust-analyzer.hover.documentation.enable#` is set.
395 --
396 [[rust-analyzer.hover.links.enable]]rust-analyzer.hover.links.enable (default: `true`)::
397 +
398 --
399 Use markdown syntax for links in hover.
400 --
401 [[rust-analyzer.imports.granularity.enforce]]rust-analyzer.imports.granularity.enforce (default: `false`)::
402 +
403 --
404 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.
405 --
406 [[rust-analyzer.imports.granularity.group]]rust-analyzer.imports.granularity.group (default: `"crate"`)::
407 +
408 --
409 How imports should be grouped into use statements.
410 --
411 [[rust-analyzer.imports.group.enable]]rust-analyzer.imports.group.enable (default: `true`)::
412 +
413 --
414 Group inserted imports by the https://rust-analyzer.github.io/manual.html#auto-import[following order]. Groups are separated by newlines.
415 --
416 [[rust-analyzer.imports.merge.glob]]rust-analyzer.imports.merge.glob (default: `true`)::
417 +
418 --
419 Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`.
420 --
421 [[rust-analyzer.imports.prefer.no.std]]rust-analyzer.imports.prefer.no.std (default: `false`)::
422 +
423 --
424 Prefer to unconditionally use imports of the core and alloc crate, over the std crate.
425 --
426 [[rust-analyzer.imports.prefix]]rust-analyzer.imports.prefix (default: `"plain"`)::
427 +
428 --
429 The path structure for newly inserted paths to use.
430 --
431 [[rust-analyzer.inlayHints.bindingModeHints.enable]]rust-analyzer.inlayHints.bindingModeHints.enable (default: `false`)::
432 +
433 --
434 Whether to show inlay type hints for binding modes.
435 --
436 [[rust-analyzer.inlayHints.chainingHints.enable]]rust-analyzer.inlayHints.chainingHints.enable (default: `true`)::
437 +
438 --
439 Whether to show inlay type hints for method chains.
440 --
441 [[rust-analyzer.inlayHints.closingBraceHints.enable]]rust-analyzer.inlayHints.closingBraceHints.enable (default: `true`)::
442 +
443 --
444 Whether to show inlay hints after a closing `}` to indicate what item it belongs to.
445 --
446 [[rust-analyzer.inlayHints.closingBraceHints.minLines]]rust-analyzer.inlayHints.closingBraceHints.minLines (default: `25`)::
447 +
448 --
449 Minimum number of lines required before the `}` until the hint is shown (set to 0 or 1
450 to always show them).
451 --
452 [[rust-analyzer.inlayHints.closureReturnTypeHints.enable]]rust-analyzer.inlayHints.closureReturnTypeHints.enable (default: `"never"`)::
453 +
454 --
455 Whether to show inlay type hints for return types of closures.
456 --
457 [[rust-analyzer.inlayHints.expressionAdjustmentHints.enable]]rust-analyzer.inlayHints.expressionAdjustmentHints.enable (default: `"never"`)::
458 +
459 --
460 Whether to show inlay hints for type adjustments.
461 --
462 [[rust-analyzer.inlayHints.lifetimeElisionHints.enable]]rust-analyzer.inlayHints.lifetimeElisionHints.enable (default: `"never"`)::
463 +
464 --
465 Whether to show inlay type hints for elided lifetimes in function signatures.
466 --
467 [[rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames]]rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames (default: `false`)::
468 +
469 --
470 Whether to prefer using parameter names as the name for elided lifetime hints if possible.
471 --
472 [[rust-analyzer.inlayHints.maxLength]]rust-analyzer.inlayHints.maxLength (default: `25`)::
473 +
474 --
475 Maximum length for inlay hints. Set to null to have an unlimited length.
476 --
477 [[rust-analyzer.inlayHints.parameterHints.enable]]rust-analyzer.inlayHints.parameterHints.enable (default: `true`)::
478 +
479 --
480 Whether to show function parameter name inlay hints at the call
481 site.
482 --
483 [[rust-analyzer.inlayHints.reborrowHints.enable]]rust-analyzer.inlayHints.reborrowHints.enable (default: `"never"`)::
484 +
485 --
486 Whether to show inlay hints for compiler inserted reborrows.
487 This setting is deprecated in favor of #rust-analyzer.inlayHints.expressionAdjustmentHints.enable#.
488 --
489 [[rust-analyzer.inlayHints.renderColons]]rust-analyzer.inlayHints.renderColons (default: `true`)::
490 +
491 --
492 Whether to render leading colons for type hints, and trailing colons for parameter hints.
493 --
494 [[rust-analyzer.inlayHints.typeHints.enable]]rust-analyzer.inlayHints.typeHints.enable (default: `true`)::
495 +
496 --
497 Whether to show inlay type hints for variables.
498 --
499 [[rust-analyzer.inlayHints.typeHints.hideClosureInitialization]]rust-analyzer.inlayHints.typeHints.hideClosureInitialization (default: `false`)::
500 +
501 --
502 Whether to hide inlay type hints for `let` statements that initialize to a closure.
503 Only applies to closures with blocks, same as `#rust-analyzer.inlayHints.closureReturnTypeHints.enable#`.
504 --
505 [[rust-analyzer.inlayHints.typeHints.hideNamedConstructor]]rust-analyzer.inlayHints.typeHints.hideNamedConstructor (default: `false`)::
506 +
507 --
508 Whether to hide inlay type hints for constructors.
509 --
510 [[rust-analyzer.joinLines.joinAssignments]]rust-analyzer.joinLines.joinAssignments (default: `true`)::
511 +
512 --
513 Join lines merges consecutive declaration and initialization of an assignment.
514 --
515 [[rust-analyzer.joinLines.joinElseIf]]rust-analyzer.joinLines.joinElseIf (default: `true`)::
516 +
517 --
518 Join lines inserts else between consecutive ifs.
519 --
520 [[rust-analyzer.joinLines.removeTrailingComma]]rust-analyzer.joinLines.removeTrailingComma (default: `true`)::
521 +
522 --
523 Join lines removes trailing commas.
524 --
525 [[rust-analyzer.joinLines.unwrapTrivialBlock]]rust-analyzer.joinLines.unwrapTrivialBlock (default: `true`)::
526 +
527 --
528 Join lines unwraps trivial blocks.
529 --
530 [[rust-analyzer.lens.debug.enable]]rust-analyzer.lens.debug.enable (default: `true`)::
531 +
532 --
533 Whether to show `Debug` lens. Only applies when
534 `#rust-analyzer.lens.enable#` is set.
535 --
536 [[rust-analyzer.lens.enable]]rust-analyzer.lens.enable (default: `true`)::
537 +
538 --
539 Whether to show CodeLens in Rust files.
540 --
541 [[rust-analyzer.lens.forceCustomCommands]]rust-analyzer.lens.forceCustomCommands (default: `true`)::
542 +
543 --
544 Internal config: use custom client-side commands even when the
545 client doesn't set the corresponding capability.
546 --
547 [[rust-analyzer.lens.implementations.enable]]rust-analyzer.lens.implementations.enable (default: `true`)::
548 +
549 --
550 Whether to show `Implementations` lens. Only applies when
551 `#rust-analyzer.lens.enable#` is set.
552 --
553 [[rust-analyzer.lens.location]]rust-analyzer.lens.location (default: `"above_name"`)::
554 +
555 --
556 Where to render annotations.
557 --
558 [[rust-analyzer.lens.references.adt.enable]]rust-analyzer.lens.references.adt.enable (default: `false`)::
559 +
560 --
561 Whether to show `References` lens for Struct, Enum, and Union.
562 Only applies when `#rust-analyzer.lens.enable#` is set.
563 --
564 [[rust-analyzer.lens.references.enumVariant.enable]]rust-analyzer.lens.references.enumVariant.enable (default: `false`)::
565 +
566 --
567 Whether to show `References` lens for Enum Variants.
568 Only applies when `#rust-analyzer.lens.enable#` is set.
569 --
570 [[rust-analyzer.lens.references.method.enable]]rust-analyzer.lens.references.method.enable (default: `false`)::
571 +
572 --
573 Whether to show `Method References` lens. Only applies when
574 `#rust-analyzer.lens.enable#` is set.
575 --
576 [[rust-analyzer.lens.references.trait.enable]]rust-analyzer.lens.references.trait.enable (default: `false`)::
577 +
578 --
579 Whether to show `References` lens for Trait.
580 Only applies when `#rust-analyzer.lens.enable#` is set.
581 --
582 [[rust-analyzer.lens.run.enable]]rust-analyzer.lens.run.enable (default: `true`)::
583 +
584 --
585 Whether to show `Run` lens. Only applies when
586 `#rust-analyzer.lens.enable#` is set.
587 --
588 [[rust-analyzer.linkedProjects]]rust-analyzer.linkedProjects (default: `[]`)::
589 +
590 --
591 Disable project auto-discovery in favor of explicitly specified set
592 of projects.
593
594 Elements must be paths pointing to `Cargo.toml`,
595 `rust-project.json`, or JSON objects in `rust-project.json` format.
596 --
597 [[rust-analyzer.lru.capacity]]rust-analyzer.lru.capacity (default: `null`)::
598 +
599 --
600 Number of syntax trees rust-analyzer keeps in memory. Defaults to 128.
601 --
602 [[rust-analyzer.notifications.cargoTomlNotFound]]rust-analyzer.notifications.cargoTomlNotFound (default: `true`)::
603 +
604 --
605 Whether to show `can't find Cargo.toml` error message.
606 --
607 [[rust-analyzer.procMacro.attributes.enable]]rust-analyzer.procMacro.attributes.enable (default: `true`)::
608 +
609 --
610 Expand attribute macros. Requires `#rust-analyzer.procMacro.enable#` to be set.
611 --
612 [[rust-analyzer.procMacro.enable]]rust-analyzer.procMacro.enable (default: `true`)::
613 +
614 --
615 Enable support for procedural macros, implies `#rust-analyzer.cargo.buildScripts.enable#`.
616 --
617 [[rust-analyzer.procMacro.ignored]]rust-analyzer.procMacro.ignored (default: `{}`)::
618 +
619 --
620 These proc-macros will be ignored when trying to expand them.
621
622 This config takes a map of crate names with the exported proc-macro names to ignore as values.
623 --
624 [[rust-analyzer.procMacro.server]]rust-analyzer.procMacro.server (default: `null`)::
625 +
626 --
627 Internal config, path to proc-macro server executable (typically,
628 this is rust-analyzer itself, but we override this in tests).
629 --
630 [[rust-analyzer.references.excludeImports]]rust-analyzer.references.excludeImports (default: `false`)::
631 +
632 --
633 Exclude imports from find-all-references.
634 --
635 [[rust-analyzer.runnables.command]]rust-analyzer.runnables.command (default: `null`)::
636 +
637 --
638 Command to be executed instead of 'cargo' for runnables.
639 --
640 [[rust-analyzer.runnables.extraArgs]]rust-analyzer.runnables.extraArgs (default: `[]`)::
641 +
642 --
643 Additional arguments to be passed to cargo for runnables such as
644 tests or binaries. For example, it may be `--release`.
645 --
646 [[rust-analyzer.rustc.source]]rust-analyzer.rustc.source (default: `null`)::
647 +
648 --
649 Path to the Cargo.toml of the rust compiler workspace, for usage in rustc_private
650 projects, or "discover" to try to automatically find it if the `rustc-dev` component
651 is installed.
652
653 Any project which uses rust-analyzer with the rustcPrivate
654 crates must set `[package.metadata.rust-analyzer] rustc_private=true` to use it.
655
656 This option does not take effect until rust-analyzer is restarted.
657 --
658 [[rust-analyzer.rustfmt.extraArgs]]rust-analyzer.rustfmt.extraArgs (default: `[]`)::
659 +
660 --
661 Additional arguments to `rustfmt`.
662 --
663 [[rust-analyzer.rustfmt.overrideCommand]]rust-analyzer.rustfmt.overrideCommand (default: `null`)::
664 +
665 --
666 Advanced option, fully override the command rust-analyzer uses for
667 formatting.
668 --
669 [[rust-analyzer.rustfmt.rangeFormatting.enable]]rust-analyzer.rustfmt.rangeFormatting.enable (default: `false`)::
670 +
671 --
672 Enables the use of rustfmt's unstable range formatting command for the
673 `textDocument/rangeFormatting` request. The rustfmt option is unstable and only
674 available on a nightly build.
675 --
676 [[rust-analyzer.semanticHighlighting.doc.comment.inject.enable]]rust-analyzer.semanticHighlighting.doc.comment.inject.enable (default: `true`)::
677 +
678 --
679 Inject additional highlighting into doc comments.
680
681 When enabled, rust-analyzer will highlight rust source in doc comments as well as intra
682 doc links.
683 --
684 [[rust-analyzer.semanticHighlighting.operator.enable]]rust-analyzer.semanticHighlighting.operator.enable (default: `true`)::
685 +
686 --
687 Use semantic tokens for operators.
688
689 When disabled, rust-analyzer will emit semantic tokens only for operator tokens when
690 they are tagged with modifiers.
691 --
692 [[rust-analyzer.semanticHighlighting.operator.specialization.enable]]rust-analyzer.semanticHighlighting.operator.specialization.enable (default: `false`)::
693 +
694 --
695 Use specialized semantic tokens for operators.
696
697 When enabled, rust-analyzer will emit special token types for operator tokens instead
698 of the generic `operator` token type.
699 --
700 [[rust-analyzer.semanticHighlighting.punctuation.enable]]rust-analyzer.semanticHighlighting.punctuation.enable (default: `false`)::
701 +
702 --
703 Use semantic tokens for punctuations.
704
705 When disabled, rust-analyzer will emit semantic tokens only for punctuation tokens when
706 they are tagged with modifiers or have a special role.
707 --
708 [[rust-analyzer.semanticHighlighting.punctuation.separate.macro.bang]]rust-analyzer.semanticHighlighting.punctuation.separate.macro.bang (default: `false`)::
709 +
710 --
711 When enabled, rust-analyzer will emit a punctuation semantic token for the `!` of macro
712 calls.
713 --
714 [[rust-analyzer.semanticHighlighting.punctuation.specialization.enable]]rust-analyzer.semanticHighlighting.punctuation.specialization.enable (default: `false`)::
715 +
716 --
717 Use specialized semantic tokens for punctuations.
718
719 When enabled, rust-analyzer will emit special token types for punctuation tokens instead
720 of the generic `punctuation` token type.
721 --
722 [[rust-analyzer.semanticHighlighting.strings.enable]]rust-analyzer.semanticHighlighting.strings.enable (default: `true`)::
723 +
724 --
725 Use semantic tokens for strings.
726
727 In some editors (e.g. vscode) semantic tokens override other highlighting grammars.
728 By disabling semantic tokens for strings, other grammars can be used to highlight
729 their contents.
730 --
731 [[rust-analyzer.signatureInfo.detail]]rust-analyzer.signatureInfo.detail (default: `"full"`)::
732 +
733 --
734 Show full signature of the callable. Only shows parameters if disabled.
735 --
736 [[rust-analyzer.signatureInfo.documentation.enable]]rust-analyzer.signatureInfo.documentation.enable (default: `true`)::
737 +
738 --
739 Show documentation.
740 --
741 [[rust-analyzer.typing.autoClosingAngleBrackets.enable]]rust-analyzer.typing.autoClosingAngleBrackets.enable (default: `false`)::
742 +
743 --
744 Whether to insert closing angle brackets when typing an opening angle bracket of a generic argument list.
745 --
746 [[rust-analyzer.workspace.symbol.search.kind]]rust-analyzer.workspace.symbol.search.kind (default: `"only_types"`)::
747 +
748 --
749 Workspace symbol search kind.
750 --
751 [[rust-analyzer.workspace.symbol.search.limit]]rust-analyzer.workspace.symbol.search.limit (default: `128`)::
752 +
753 --
754 Limits the number of items returned from a workspace symbol search (Defaults to 128).
755 Some clients like vs-code issue new searches on result filtering and don't require all results to be returned in the initial search.
756 Other clients requires all results upfront and might require a higher limit.
757 --
758 [[rust-analyzer.workspace.symbol.search.scope]]rust-analyzer.workspace.symbol.search.scope (default: `"workspace"`)::
759 +
760 --
761 Workspace symbol search scope.
762 --