2022-10-06 18:41:02 +00:00
|
|
|
[[rust-analyzer.assist.emitMustUse]]rust-analyzer.assist.emitMustUse (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
2022-10-24 15:36:32 +00:00
|
|
|
Whether to insert #[must_use] when generating `as_` methods
|
2022-10-06 18:41:02 +00:00
|
|
|
for enum variants.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.assist.expressionFillDefault]]rust-analyzer.assist.expressionFillDefault (default: `"todo"`)::
|
2021-12-31 15:11:17 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-29 13:48:48 +00:00
|
|
|
Placeholder expression to use for missing expressions in assists.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-05-12 10:29:40 +00:00
|
|
|
[[rust-analyzer.cachePriming.enable]]rust-analyzer.cachePriming.enable (default: `true`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Warm up caches on project load.
|
|
|
|
--
|
|
|
|
[[rust-analyzer.cachePriming.numThreads]]rust-analyzer.cachePriming.numThreads (default: `0`)::
|
|
|
|
+
|
|
|
|
--
|
2022-05-19 14:04:02 +00:00
|
|
|
How many worker threads to handle priming caches. The default `0` means to pick automatically.
|
2022-05-12 10:29:40 +00:00
|
|
|
--
|
2021-01-05 10:09:06 +00:00
|
|
|
[[rust-analyzer.cargo.autoreload]]rust-analyzer.cargo.autoreload (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Automatically refresh project info via `cargo metadata` on
|
2022-04-26 22:02:45 +00:00
|
|
|
`Cargo.toml` or `.cargo/config.toml` changes.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.cargo.buildScripts.enable]]rust-analyzer.cargo.buildScripts.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Run build scripts (`build.rs`) for more precise code analysis.
|
|
|
|
--
|
2022-10-22 21:02:59 +00:00
|
|
|
[[rust-analyzer.cargo.buildScripts.invocationLocation]]rust-analyzer.cargo.buildScripts.invocationLocation (default: `"workspace"`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Specifies the working directory for running build scripts.
|
|
|
|
- "workspace": run build scripts for a workspace in the workspace's root directory.
|
|
|
|
This is incompatible with `#rust-analyzer.cargo.buildScripts.invocationStrategy#` set to `once`.
|
|
|
|
- "root": run build scripts in the project's root directory.
|
|
|
|
This config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`
|
|
|
|
is set.
|
|
|
|
--
|
2022-08-27 16:28:09 +00:00
|
|
|
[[rust-analyzer.cargo.buildScripts.invocationStrategy]]rust-analyzer.cargo.buildScripts.invocationStrategy (default: `"per_workspace"`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Specifies the invocation strategy to use when running the build scripts command.
|
2022-10-22 21:02:59 +00:00
|
|
|
If `per_workspace` is set, the command will be executed for each workspace.
|
|
|
|
If `once` is set, the command will be executed once.
|
2022-09-26 13:58:55 +00:00
|
|
|
This config only has an effect when `#rust-analyzer.cargo.buildScripts.overrideCommand#`
|
|
|
|
is set.
|
2022-08-27 16:28:09 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.cargo.buildScripts.overrideCommand]]rust-analyzer.cargo.buildScripts.overrideCommand (default: `null`)::
|
2021-06-14 04:41:46 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-29 13:48:48 +00:00
|
|
|
Override the command rust-analyzer uses to run build scripts and
|
|
|
|
build procedural macros. The command is required to output json
|
2022-07-04 16:45:54 +00:00
|
|
|
and should therefore include `--message-format=json` or a similar
|
2022-04-29 13:48:48 +00:00
|
|
|
option.
|
|
|
|
|
2023-09-22 15:46:17 +00:00
|
|
|
If there are multiple linked projects/workspaces, this command is invoked for
|
|
|
|
each of them, with the working directory being the workspace root
|
|
|
|
(i.e., the folder containing the `Cargo.toml`). This can be overwritten
|
|
|
|
by changing `#rust-analyzer.cargo.buildScripts.invocationStrategy#` and
|
|
|
|
`#rust-analyzer.cargo.buildScripts.invocationLocation#`.
|
|
|
|
|
2022-04-29 13:48:48 +00:00
|
|
|
By default, a cargo invocation will be constructed for the configured
|
|
|
|
targets and features, with the following base command line:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cargo check --quiet --workspace --message-format=json --all-targets
|
|
|
|
```
|
|
|
|
.
|
2022-04-11 03:13:50 +00:00
|
|
|
--
|
2023-12-08 03:31:56 +00:00
|
|
|
[[rust-analyzer.cargo.buildScripts.rebuildOnSave]]rust-analyzer.cargo.buildScripts.rebuildOnSave (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Rerun proc-macros building/build-scripts running when proc-macro
|
|
|
|
or build-script sources change and are saved.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.cargo.buildScripts.useRustcWrapper]]rust-analyzer.cargo.buildScripts.useRustcWrapper (default: `true`)::
|
2021-04-12 08:04:36 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Use `RUSTC_WRAPPER=rust-analyzer` when running build scripts to
|
2022-07-04 16:45:54 +00:00
|
|
|
avoid checking unnecessary things.
|
2021-06-14 04:41:46 +00:00
|
|
|
--
|
2023-05-26 20:12:22 +00:00
|
|
|
[[rust-analyzer.cargo.cfgs]]rust-analyzer.cargo.cfgs (default: `{}`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
List of cfg options to enable with the given values.
|
|
|
|
--
|
2023-03-12 10:59:57 +00:00
|
|
|
[[rust-analyzer.cargo.extraArgs]]rust-analyzer.cargo.extraArgs (default: `[]`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Extra arguments that are passed to every cargo invocation.
|
|
|
|
--
|
2022-08-18 21:41:17 +00:00
|
|
|
[[rust-analyzer.cargo.extraEnv]]rust-analyzer.cargo.extraEnv (default: `{}`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Extra environment variables that will be set when running cargo, rustc
|
|
|
|
or other commands within the workspace. Useful for setting RUSTFLAGS.
|
|
|
|
--
|
2021-01-05 10:09:06 +00:00
|
|
|
[[rust-analyzer.cargo.features]]rust-analyzer.cargo.features (default: `[]`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
List of features to activate.
|
2022-04-29 13:48:48 +00:00
|
|
|
|
|
|
|
Set this to `"all"` to pass `--all-features` to cargo.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.cargo.noDefaultFeatures]]rust-analyzer.cargo.noDefaultFeatures (default: `false`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-29 13:48:48 +00:00
|
|
|
Whether to pass `--no-default-features` to cargo.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-10-01 18:47:31 +00:00
|
|
|
[[rust-analyzer.cargo.sysroot]]rust-analyzer.cargo.sysroot (default: `"discover"`)::
|
2022-04-11 03:13:50 +00:00
|
|
|
+
|
|
|
|
--
|
2022-10-01 18:47:31 +00:00
|
|
|
Relative path to the sysroot, or "discover" to try to automatically find it via
|
|
|
|
"rustc --print sysroot".
|
|
|
|
|
|
|
|
Unsetting this disables sysroot loading.
|
|
|
|
|
2023-02-06 11:07:33 +00:00
|
|
|
This option does not take effect until rust-analyzer is restarted.
|
|
|
|
--
|
2024-01-13 16:22:39 +00:00
|
|
|
[[rust-analyzer.cargo.sysrootQueryMetadata]]rust-analyzer.cargo.sysrootQueryMetadata (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to run cargo metadata on the sysroot library allowing rust-analyzer to analyze
|
|
|
|
third-party dependencies of the standard libraries.
|
|
|
|
|
|
|
|
This will cause `cargo` to create a lockfile in your sysroot directory. rust-analyzer
|
|
|
|
will attempt to clean up afterwards, but nevertheless requires the location to be
|
|
|
|
writable to.
|
|
|
|
--
|
2023-02-06 11:07:33 +00:00
|
|
|
[[rust-analyzer.cargo.sysrootSrc]]rust-analyzer.cargo.sysrootSrc (default: `null`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Relative path to the sysroot library sources. If left unset, this will default to
|
|
|
|
`{cargo.sysroot}/lib/rustlib/src/rust/library`.
|
|
|
|
|
2022-10-01 18:47:31 +00:00
|
|
|
This option does not take effect until rust-analyzer is restarted.
|
2022-04-11 03:13:50 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.cargo.target]]rust-analyzer.cargo.target (default: `null`)::
|
2021-04-12 08:04:36 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Compilation target override (target triple).
|
2021-04-12 08:04:36 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.cargo.unsetTest]]rust-analyzer.cargo.unsetTest (default: `["core"]`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2023-05-26 20:12:22 +00:00
|
|
|
Unsets the implicit `#[cfg(test)]` for the specified crates.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-12-20 10:31:07 +00:00
|
|
|
[[rust-analyzer.checkOnSave]]rust-analyzer.checkOnSave (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2023-01-09 13:15:13 +00:00
|
|
|
Run the check command for diagnostics on save.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2023-01-09 13:15:13 +00:00
|
|
|
[[rust-analyzer.check.allTargets]]rust-analyzer.check.allTargets (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2023-01-09 13:15:13 +00:00
|
|
|
Check all targets and tests (`--all-targets`).
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2023-01-09 13:15:13 +00:00
|
|
|
[[rust-analyzer.check.command]]rust-analyzer.check.command (default: `"check"`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2023-01-09 13:15:13 +00:00
|
|
|
Cargo command to use for `cargo check`.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2023-01-09 13:15:13 +00:00
|
|
|
[[rust-analyzer.check.extraArgs]]rust-analyzer.check.extraArgs (default: `[]`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Extra arguments for `cargo check`.
|
|
|
|
--
|
2023-01-09 13:15:13 +00:00
|
|
|
[[rust-analyzer.check.extraEnv]]rust-analyzer.check.extraEnv (default: `{}`)::
|
2022-08-18 21:41:17 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Extra environment variables that will be set when running `cargo check`.
|
2022-09-19 15:31:08 +00:00
|
|
|
Extends `#rust-analyzer.cargo.extraEnv#`.
|
2022-08-18 21:41:17 +00:00
|
|
|
--
|
2023-01-09 13:15:13 +00:00
|
|
|
[[rust-analyzer.check.features]]rust-analyzer.check.features (default: `null`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
List of features to activate. Defaults to
|
2022-04-29 13:48:48 +00:00
|
|
|
`#rust-analyzer.cargo.features#`.
|
|
|
|
|
2022-07-04 16:45:54 +00:00
|
|
|
Set to `"all"` to pass `--all-features` to Cargo.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2023-05-13 14:12:32 +00:00
|
|
|
[[rust-analyzer.check.ignore]]rust-analyzer.check.ignore (default: `[]`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
List of `cargo check` (or other command specified in `check.command`) diagnostics to ignore.
|
|
|
|
|
|
|
|
For example for `cargo check`: `dead_code`, `unused_imports`, `unused_variables`,...
|
|
|
|
--
|
2023-01-09 13:15:13 +00:00
|
|
|
[[rust-analyzer.check.invocationLocation]]rust-analyzer.check.invocationLocation (default: `"workspace"`)::
|
2022-10-22 21:02:59 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Specifies the working directory for running checks.
|
|
|
|
- "workspace": run checks for workspaces in the corresponding workspaces' root directories.
|
2023-12-08 19:23:15 +00:00
|
|
|
This falls back to "root" if `#rust-analyzer.check.invocationStrategy#` is set to `once`.
|
2022-10-22 21:02:59 +00:00
|
|
|
- "root": run checks in the project's root directory.
|
2023-12-08 19:23:15 +00:00
|
|
|
This config only has an effect when `#rust-analyzer.check.overrideCommand#`
|
2022-10-22 21:02:59 +00:00
|
|
|
is set.
|
|
|
|
--
|
2023-01-09 13:15:13 +00:00
|
|
|
[[rust-analyzer.check.invocationStrategy]]rust-analyzer.check.invocationStrategy (default: `"per_workspace"`)::
|
2022-09-15 11:28:09 +00:00
|
|
|
+
|
|
|
|
--
|
2023-08-21 07:21:06 +00:00
|
|
|
Specifies the invocation strategy to use when running the check command.
|
2022-10-22 21:02:59 +00:00
|
|
|
If `per_workspace` is set, the command will be executed for each workspace.
|
|
|
|
If `once` is set, the command will be executed once.
|
2023-12-08 19:23:15 +00:00
|
|
|
This config only has an effect when `#rust-analyzer.check.overrideCommand#`
|
2022-09-26 13:58:55 +00:00
|
|
|
is set.
|
2022-09-15 11:28:09 +00:00
|
|
|
--
|
2023-01-09 13:15:13 +00:00
|
|
|
[[rust-analyzer.check.noDefaultFeatures]]rust-analyzer.check.noDefaultFeatures (default: `null`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-07-04 16:45:54 +00:00
|
|
|
Whether to pass `--no-default-features` to Cargo. Defaults to
|
2022-05-14 11:53:41 +00:00
|
|
|
`#rust-analyzer.cargo.noDefaultFeatures#`.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2023-01-09 13:15:13 +00:00
|
|
|
[[rust-analyzer.check.overrideCommand]]rust-analyzer.check.overrideCommand (default: `null`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-07-04 16:45:54 +00:00
|
|
|
Override the command rust-analyzer uses instead of `cargo check` for
|
|
|
|
diagnostics on save. The command is required to output json and
|
2022-12-25 18:52:42 +00:00
|
|
|
should therefore include `--message-format=json` or a similar option
|
2023-01-04 17:04:45 +00:00
|
|
|
(if your client supports the `colorDiagnosticOutput` experimental
|
|
|
|
capability, you can use `--message-format=json-diagnostic-rendered-ansi`).
|
2022-07-04 16:45:54 +00:00
|
|
|
|
|
|
|
If you're changing this because you're using some tool wrapping
|
|
|
|
Cargo, you might also want to change
|
|
|
|
`#rust-analyzer.cargo.buildScripts.overrideCommand#`.
|
2022-04-29 13:48:48 +00:00
|
|
|
|
2023-09-22 15:46:17 +00:00
|
|
|
If there are multiple linked projects/workspaces, this command is invoked for
|
|
|
|
each of them, with the working directory being the workspace root
|
|
|
|
(i.e., the folder containing the `Cargo.toml`). This can be overwritten
|
2023-12-08 19:23:15 +00:00
|
|
|
by changing `#rust-analyzer.check.invocationStrategy#` and
|
|
|
|
`#rust-analyzer.check.invocationLocation#`.
|
2022-08-19 12:23:58 +00:00
|
|
|
|
2022-04-29 13:48:48 +00:00
|
|
|
An example command would be:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cargo check --workspace --message-format=json --all-targets
|
|
|
|
```
|
|
|
|
.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2023-01-09 13:15:13 +00:00
|
|
|
[[rust-analyzer.check.targets]]rust-analyzer.check.targets (default: `null`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-09-24 23:22:27 +00:00
|
|
|
Check for specific targets. Defaults to `#rust-analyzer.cargo.target#` if empty.
|
|
|
|
|
|
|
|
Can be a single target, e.g. `"x86_64-unknown-linux-gnu"` or a list of targets, e.g.
|
|
|
|
`["aarch64-apple-darwin", "x86_64-apple-darwin"]`.
|
|
|
|
|
|
|
|
Aliased as `"checkOnSave.targets"`.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.completion.autoimport.enable]]rust-analyzer.completion.autoimport.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Toggles the additional completions that automatically add imports when completed.
|
|
|
|
Note that your client must specify the `additionalTextEdits` LSP client capability to truly have this feature enabled.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.completion.autoself.enable]]rust-analyzer.completion.autoself.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Toggles the additional completions that automatically show method calls and field accesses
|
|
|
|
with `self` prefixed to them when inside a method.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.completion.callable.snippets]]rust-analyzer.completion.callable.snippets (default: `"fill_arguments"`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Whether to add parenthesis and argument snippets when completing function.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2023-09-04 03:02:08 +00:00
|
|
|
[[rust-analyzer.completion.fullFunctionSignatures.enable]]rust-analyzer.completion.fullFunctionSignatures.enable (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show full function/method signatures in completion docs.
|
|
|
|
--
|
2023-01-20 02:34:19 +00:00
|
|
|
[[rust-analyzer.completion.limit]]rust-analyzer.completion.limit (default: `null`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Maximum number of completions to return. If `None`, the limit is infinite.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.completion.postfix.enable]]rust-analyzer.completion.postfix.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Whether to show postfix snippets like `dbg`, `if`, `not`, etc.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.completion.privateEditable.enable]]rust-analyzer.completion.privateEditable.enable (default: `false`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Enables completions of private items and fields that are defined in the current workspace even if they are not visible at the current position.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.completion.snippets.custom]]rust-analyzer.completion.snippets.custom::
|
2022-01-11 04:47:54 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Default:
|
|
|
|
----
|
|
|
|
{
|
2021-10-12 10:14:24 +00:00
|
|
|
"Arc::new": {
|
|
|
|
"postfix": "arc",
|
|
|
|
"body": "Arc::new(${receiver})",
|
|
|
|
"requires": "std::sync::Arc",
|
|
|
|
"description": "Put the expression into an `Arc`",
|
|
|
|
"scope": "expr"
|
|
|
|
},
|
|
|
|
"Rc::new": {
|
|
|
|
"postfix": "rc",
|
|
|
|
"body": "Rc::new(${receiver})",
|
|
|
|
"requires": "std::rc::Rc",
|
|
|
|
"description": "Put the expression into an `Rc`",
|
|
|
|
"scope": "expr"
|
|
|
|
},
|
|
|
|
"Box::pin": {
|
|
|
|
"postfix": "pinbox",
|
|
|
|
"body": "Box::pin(${receiver})",
|
|
|
|
"requires": "std::boxed::Box",
|
|
|
|
"description": "Put the expression into a pinned `Box`",
|
|
|
|
"scope": "expr"
|
|
|
|
},
|
|
|
|
"Ok": {
|
|
|
|
"postfix": "ok",
|
|
|
|
"body": "Ok(${receiver})",
|
|
|
|
"description": "Wrap the expression in a `Result::Ok`",
|
|
|
|
"scope": "expr"
|
|
|
|
},
|
|
|
|
"Err": {
|
|
|
|
"postfix": "err",
|
|
|
|
"body": "Err(${receiver})",
|
|
|
|
"description": "Wrap the expression in a `Result::Err`",
|
|
|
|
"scope": "expr"
|
|
|
|
},
|
|
|
|
"Some": {
|
|
|
|
"postfix": "some",
|
|
|
|
"body": "Some(${receiver})",
|
|
|
|
"description": "Wrap the expression in an `Option::Some`",
|
|
|
|
"scope": "expr"
|
|
|
|
}
|
2022-01-11 04:47:54 +00:00
|
|
|
}
|
|
|
|
----
|
2021-10-04 19:47:02 +00:00
|
|
|
Custom completion snippets.
|
2022-01-11 04:47:54 +00:00
|
|
|
|
2021-10-04 19:47:02 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.diagnostics.disabled]]rust-analyzer.diagnostics.disabled (default: `[]`)::
|
2022-02-23 15:02:54 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
List of rust-analyzer diagnostics to disable.
|
2022-02-23 15:02:54 +00:00
|
|
|
--
|
2021-01-05 10:09:06 +00:00
|
|
|
[[rust-analyzer.diagnostics.enable]]rust-analyzer.diagnostics.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show native rust-analyzer diagnostics.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.diagnostics.experimental.enable]]rust-analyzer.diagnostics.experimental.enable (default: `false`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show experimental rust-analyzer diagnostics that might
|
|
|
|
have more false positives than usual.
|
|
|
|
--
|
2021-04-21 22:09:37 +00:00
|
|
|
[[rust-analyzer.diagnostics.remapPrefix]]rust-analyzer.diagnostics.remapPrefix (default: `{}`)::
|
2021-04-21 03:03:35 +00:00
|
|
|
+
|
|
|
|
--
|
2021-04-21 22:09:37 +00:00
|
|
|
Map of prefixes to be substituted when parsing diagnostic file paths.
|
2021-04-21 03:03:35 +00:00
|
|
|
This should be the reverse mapping of what is passed to `rustc` as `--remap-path-prefix`.
|
|
|
|
--
|
2021-01-05 10:09:06 +00:00
|
|
|
[[rust-analyzer.diagnostics.warningsAsHint]]rust-analyzer.diagnostics.warningsAsHint (default: `[]`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2021-05-29 16:08:14 +00:00
|
|
|
List of warnings that should be displayed with hint severity.
|
2021-03-09 11:43:05 +00:00
|
|
|
|
2021-05-29 16:08:14 +00:00
|
|
|
The warnings will be indicated by faded text or three dots in code
|
|
|
|
and will not show up in the `Problems Panel`.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2021-01-05 10:09:06 +00:00
|
|
|
[[rust-analyzer.diagnostics.warningsAsInfo]]rust-analyzer.diagnostics.warningsAsInfo (default: `[]`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2021-05-29 16:08:14 +00:00
|
|
|
List of warnings that should be displayed with info severity.
|
2021-03-09 11:43:05 +00:00
|
|
|
|
2021-05-29 16:08:14 +00:00
|
|
|
The warnings will be indicated by a blue squiggly underline in code
|
|
|
|
and a blue icon in the `Problems Panel`.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2021-01-26 13:18:01 +00:00
|
|
|
[[rust-analyzer.files.excludeDirs]]rust-analyzer.files.excludeDirs (default: `[]`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2021-07-19 13:09:29 +00:00
|
|
|
These directories will be ignored by rust-analyzer. They are
|
|
|
|
relative to the workspace root, and globs are not supported. You may
|
2021-07-22 11:03:06 +00:00
|
|
|
also need to add the folders to Code's `files.watcherExclude`.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.files.watcher]]rust-analyzer.files.watcher (default: `"client"`)::
|
2021-07-23 01:04:27 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Controls file watching implementation.
|
2021-07-23 01:04:27 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.highlightRelated.breakPoints.enable]]rust-analyzer.highlightRelated.breakPoints.enable (default: `true`)::
|
2021-07-23 01:04:27 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-29 13:48:48 +00:00
|
|
|
Enables highlighting of related references while the cursor is on `break`, `loop`, `while`, or `for` keywords.
|
2021-07-23 01:04:27 +00:00
|
|
|
--
|
2023-05-02 06:52:08 +00:00
|
|
|
[[rust-analyzer.highlightRelated.closureCaptures.enable]]rust-analyzer.highlightRelated.closureCaptures.enable (default: `true`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Enables highlighting of all captures of a closure while the cursor is on the `|` or move keyword of a closure.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.highlightRelated.exitPoints.enable]]rust-analyzer.highlightRelated.exitPoints.enable (default: `true`)::
|
2021-05-17 15:37:06 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-29 13:48:48 +00:00
|
|
|
Enables highlighting of all exit points while the cursor is on any `return`, `?`, `fn`, or return type arrow (`->`).
|
2021-05-17 15:37:06 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.highlightRelated.references.enable]]rust-analyzer.highlightRelated.references.enable (default: `true`)::
|
2021-06-14 13:25:10 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-29 13:48:48 +00:00
|
|
|
Enables highlighting of related references while the cursor is on any identifier.
|
2021-06-14 13:25:10 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.highlightRelated.yieldPoints.enable]]rust-analyzer.highlightRelated.yieldPoints.enable (default: `true`)::
|
2021-06-14 13:25:10 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-29 13:48:48 +00:00
|
|
|
Enables highlighting of all break points for a loop or block context while the cursor is on any `async` or `await` keywords.
|
2021-06-14 13:25:10 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.hover.actions.debug.enable]]rust-analyzer.hover.actions.debug.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show `Debug` action. Only applies when
|
2022-05-13 19:17:03 +00:00
|
|
|
`#rust-analyzer.hover.actions.enable#` is set.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.hover.actions.enable]]rust-analyzer.hover.actions.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show HoverActions in Rust files.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.hover.actions.gotoTypeDef.enable]]rust-analyzer.hover.actions.gotoTypeDef.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show `Go to Type Definition` action. Only applies when
|
2022-05-13 19:17:03 +00:00
|
|
|
`#rust-analyzer.hover.actions.enable#` is set.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.hover.actions.implementations.enable]]rust-analyzer.hover.actions.implementations.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show `Implementations` action. Only applies when
|
2022-05-13 19:17:03 +00:00
|
|
|
`#rust-analyzer.hover.actions.enable#` is set.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.hover.actions.references.enable]]rust-analyzer.hover.actions.references.enable (default: `false`)::
|
2021-06-04 13:49:43 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show `References` action. Only applies when
|
2022-05-13 19:17:03 +00:00
|
|
|
`#rust-analyzer.hover.actions.enable#` is set.
|
2021-06-04 13:49:43 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.hover.actions.run.enable]]rust-analyzer.hover.actions.run.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show `Run` action. Only applies when
|
2022-05-13 19:17:03 +00:00
|
|
|
`#rust-analyzer.hover.actions.enable#` is set.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.hover.documentation.enable]]rust-analyzer.hover.documentation.enable (default: `true`)::
|
2022-03-11 20:06:26 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Whether to show documentation on hover.
|
2022-03-11 20:06:26 +00:00
|
|
|
--
|
2022-08-16 16:12:15 +00:00
|
|
|
[[rust-analyzer.hover.documentation.keywords.enable]]rust-analyzer.hover.documentation.keywords.enable (default: `true`)::
|
2022-08-16 14:51:40 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show keyword hover popups. Only applies when
|
|
|
|
`#rust-analyzer.hover.documentation.enable#` is set.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.hover.links.enable]]rust-analyzer.hover.links.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2023-05-07 15:21:07 +00:00
|
|
|
Use markdown syntax for links on hover.
|
|
|
|
--
|
2023-05-30 14:20:01 +00:00
|
|
|
[[rust-analyzer.hover.memoryLayout.alignment]]rust-analyzer.hover.memoryLayout.alignment (default: `"hexadecimal"`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
How to render the align information in a memory layout hover.
|
|
|
|
--
|
2023-05-07 15:37:56 +00:00
|
|
|
[[rust-analyzer.hover.memoryLayout.enable]]rust-analyzer.hover.memoryLayout.enable (default: `true`)::
|
2023-05-07 15:21:07 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show memory layout data on hover.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2023-05-30 14:20:01 +00:00
|
|
|
[[rust-analyzer.hover.memoryLayout.niches]]rust-analyzer.hover.memoryLayout.niches (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
How to render the niche information in a memory layout hover.
|
|
|
|
--
|
|
|
|
[[rust-analyzer.hover.memoryLayout.offset]]rust-analyzer.hover.memoryLayout.offset (default: `"hexadecimal"`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
How to render the offset information in a memory layout hover.
|
|
|
|
--
|
|
|
|
[[rust-analyzer.hover.memoryLayout.size]]rust-analyzer.hover.memoryLayout.size (default: `"both"`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
How to render the size information in a memory layout hover.
|
|
|
|
--
|
2022-04-29 08:56:32 +00:00
|
|
|
[[rust-analyzer.imports.granularity.enforce]]rust-analyzer.imports.granularity.enforce (default: `false`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
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.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-29 08:56:32 +00:00
|
|
|
[[rust-analyzer.imports.granularity.group]]rust-analyzer.imports.granularity.group (default: `"crate"`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
How imports should be grouped into use statements.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-29 08:56:32 +00:00
|
|
|
[[rust-analyzer.imports.group.enable]]rust-analyzer.imports.group.enable (default: `true`)::
|
2022-03-16 20:16:55 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Group inserted imports by the https://rust-analyzer.github.io/manual.html#auto-import[following order]. Groups are separated by newlines.
|
2022-03-16 20:16:55 +00:00
|
|
|
--
|
2022-04-29 08:56:32 +00:00
|
|
|
[[rust-analyzer.imports.merge.glob]]rust-analyzer.imports.merge.glob (default: `true`)::
|
2022-03-16 20:16:55 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Whether to allow import insertion to merge new imports into single path glob imports like `use std::fmt::*;`.
|
2022-03-16 20:16:55 +00:00
|
|
|
--
|
2023-11-12 16:48:40 +00:00
|
|
|
[[rust-analyzer.imports.preferNoStd]]rust-analyzer.imports.preferNoStd (default: `false`)::
|
2022-09-09 18:04:56 +00:00
|
|
|
+
|
|
|
|
--
|
2022-09-13 13:09:40 +00:00
|
|
|
Prefer to unconditionally use imports of the core and alloc crate, over the std crate.
|
2022-09-09 18:04:56 +00:00
|
|
|
--
|
2023-11-12 16:48:40 +00:00
|
|
|
[[rust-analyzer.imports.preferPrelude]]rust-analyzer.imports.preferPrelude (default: `false`)::
|
2023-11-11 13:52:11 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to prefer import paths containing a `prelude` module.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.imports.prefix]]rust-analyzer.imports.prefix (default: `"plain"`)::
|
2022-03-20 13:38:16 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
The path structure for newly inserted paths to use.
|
|
|
|
--
|
2022-05-14 13:18:18 +00:00
|
|
|
[[rust-analyzer.inlayHints.bindingModeHints.enable]]rust-analyzer.inlayHints.bindingModeHints.enable (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show inlay type hints for binding modes.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.inlayHints.chainingHints.enable]]rust-analyzer.inlayHints.chainingHints.enable (default: `true`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show inlay type hints for method chains.
|
|
|
|
--
|
2022-05-13 17:42:59 +00:00
|
|
|
[[rust-analyzer.inlayHints.closingBraceHints.enable]]rust-analyzer.inlayHints.closingBraceHints.enable (default: `true`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show inlay hints after a closing `}` to indicate what item it belongs to.
|
|
|
|
--
|
|
|
|
[[rust-analyzer.inlayHints.closingBraceHints.minLines]]rust-analyzer.inlayHints.closingBraceHints.minLines (default: `25`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Minimum number of lines required before the `}` until the hint is shown (set to 0 or 1
|
|
|
|
to always show them).
|
|
|
|
--
|
2023-05-05 11:34:55 +00:00
|
|
|
[[rust-analyzer.inlayHints.closureCaptureHints.enable]]rust-analyzer.inlayHints.closureCaptureHints.enable (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show inlay hints for closure captures.
|
|
|
|
--
|
2022-05-28 12:13:25 +00:00
|
|
|
[[rust-analyzer.inlayHints.closureReturnTypeHints.enable]]rust-analyzer.inlayHints.closureReturnTypeHints.enable (default: `"never"`)::
|
2022-04-26 12:39:06 +00:00
|
|
|
+
|
|
|
|
--
|
2022-05-28 12:13:25 +00:00
|
|
|
Whether to show inlay type hints for return types of closures.
|
2022-03-20 13:38:16 +00:00
|
|
|
--
|
2023-04-06 12:44:38 +00:00
|
|
|
[[rust-analyzer.inlayHints.closureStyle]]rust-analyzer.inlayHints.closureStyle (default: `"impl_fn"`)::
|
|
|
|
+
|
|
|
|
--
|
2023-04-13 22:35:00 +00:00
|
|
|
Closure notation in type and chaining inlay hints.
|
2023-04-06 12:44:38 +00:00
|
|
|
--
|
2022-12-23 10:28:46 +00:00
|
|
|
[[rust-analyzer.inlayHints.discriminantHints.enable]]rust-analyzer.inlayHints.discriminantHints.enable (default: `"never"`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show enum variant discriminant hints.
|
|
|
|
--
|
2022-11-04 21:59:07 +00:00
|
|
|
[[rust-analyzer.inlayHints.expressionAdjustmentHints.enable]]rust-analyzer.inlayHints.expressionAdjustmentHints.enable (default: `"never"`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show inlay hints for type adjustments.
|
|
|
|
--
|
2022-12-21 18:18:12 +00:00
|
|
|
[[rust-analyzer.inlayHints.expressionAdjustmentHints.hideOutsideUnsafe]]rust-analyzer.inlayHints.expressionAdjustmentHints.hideOutsideUnsafe (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to hide inlay hints for type adjustments outside of `unsafe` blocks.
|
|
|
|
--
|
2022-12-21 15:00:05 +00:00
|
|
|
[[rust-analyzer.inlayHints.expressionAdjustmentHints.mode]]rust-analyzer.inlayHints.expressionAdjustmentHints.mode (default: `"prefix"`)::
|
2022-12-20 22:07:00 +00:00
|
|
|
+
|
|
|
|
--
|
2022-12-21 15:00:05 +00:00
|
|
|
Whether to show inlay hints as postfix ops (`.*` instead of `*`, etc).
|
2022-12-20 22:07:00 +00:00
|
|
|
--
|
2023-12-01 12:46:46 +00:00
|
|
|
[[rust-analyzer.inlayHints.implicitDrops.enable]]rust-analyzer.inlayHints.implicitDrops.enable (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show implicit drop hints.
|
|
|
|
--
|
2022-03-22 15:27:59 +00:00
|
|
|
[[rust-analyzer.inlayHints.lifetimeElisionHints.enable]]rust-analyzer.inlayHints.lifetimeElisionHints.enable (default: `"never"`)::
|
2022-03-19 18:01:19 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show inlay type hints for elided lifetimes in function signatures.
|
|
|
|
--
|
2022-03-19 19:12:14 +00:00
|
|
|
[[rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames]]rust-analyzer.inlayHints.lifetimeElisionHints.useParameterNames (default: `false`)::
|
2022-03-19 18:01:19 +00:00
|
|
|
+
|
|
|
|
--
|
2022-03-19 19:12:14 +00:00
|
|
|
Whether to prefer using parameter names as the name for elided lifetime hints if possible.
|
2022-03-19 18:01:19 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.inlayHints.maxLength]]rust-analyzer.inlayHints.maxLength (default: `25`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Maximum length for inlay hints. Set to null to have an unlimited length.
|
|
|
|
--
|
|
|
|
[[rust-analyzer.inlayHints.parameterHints.enable]]rust-analyzer.inlayHints.parameterHints.enable (default: `true`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show function parameter name inlay hints at the call
|
|
|
|
site.
|
|
|
|
--
|
2024-01-06 22:03:45 +00:00
|
|
|
[[rust-analyzer.inlayHints.rangeExclusiveHints.enable]]rust-analyzer.inlayHints.rangeExclusiveHints.enable (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show exclusive range inlay hints.
|
|
|
|
--
|
2022-05-12 11:39:32 +00:00
|
|
|
[[rust-analyzer.inlayHints.reborrowHints.enable]]rust-analyzer.inlayHints.reborrowHints.enable (default: `"never"`)::
|
2022-04-26 12:39:06 +00:00
|
|
|
+
|
|
|
|
--
|
2022-11-04 21:59:07 +00:00
|
|
|
Whether to show inlay hints for compiler inserted reborrows.
|
|
|
|
This setting is deprecated in favor of #rust-analyzer.inlayHints.expressionAdjustmentHints.enable#.
|
2022-04-26 12:39:06 +00:00
|
|
|
--
|
|
|
|
[[rust-analyzer.inlayHints.renderColons]]rust-analyzer.inlayHints.renderColons (default: `true`)::
|
|
|
|
+
|
|
|
|
--
|
2022-05-11 02:15:07 +00:00
|
|
|
Whether to render leading colons for type hints, and trailing colons for parameter hints.
|
2022-04-26 12:39:06 +00:00
|
|
|
--
|
|
|
|
[[rust-analyzer.inlayHints.typeHints.enable]]rust-analyzer.inlayHints.typeHints.enable (default: `true`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show inlay type hints for variables.
|
|
|
|
--
|
2022-05-15 11:17:52 +00:00
|
|
|
[[rust-analyzer.inlayHints.typeHints.hideClosureInitialization]]rust-analyzer.inlayHints.typeHints.hideClosureInitialization (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to hide inlay type hints for `let` statements that initialize to a closure.
|
|
|
|
Only applies to closures with blocks, same as `#rust-analyzer.inlayHints.closureReturnTypeHints.enable#`.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.inlayHints.typeHints.hideNamedConstructor]]rust-analyzer.inlayHints.typeHints.hideNamedConstructor (default: `false`)::
|
2021-11-13 23:12:29 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-29 13:48:48 +00:00
|
|
|
Whether to hide inlay type hints for constructors.
|
2021-11-13 23:12:29 +00:00
|
|
|
--
|
2023-02-03 11:16:25 +00:00
|
|
|
[[rust-analyzer.interpret.tests]]rust-analyzer.interpret.tests (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Enables the experimental support for interpreting tests.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.joinLines.joinAssignments]]rust-analyzer.joinLines.joinAssignments (default: `true`)::
|
2021-11-13 23:12:29 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Join lines merges consecutive declaration and initialization of an assignment.
|
2021-11-13 23:12:29 +00:00
|
|
|
--
|
2021-07-05 20:31:44 +00:00
|
|
|
[[rust-analyzer.joinLines.joinElseIf]]rust-analyzer.joinLines.joinElseIf (default: `true`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Join lines inserts else between consecutive ifs.
|
|
|
|
--
|
|
|
|
[[rust-analyzer.joinLines.removeTrailingComma]]rust-analyzer.joinLines.removeTrailingComma (default: `true`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Join lines removes trailing commas.
|
|
|
|
--
|
|
|
|
[[rust-analyzer.joinLines.unwrapTrivialBlock]]rust-analyzer.joinLines.unwrapTrivialBlock (default: `true`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Join lines unwraps trivial blocks.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.lens.debug.enable]]rust-analyzer.lens.debug.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show `Debug` lens. Only applies when
|
|
|
|
`#rust-analyzer.lens.enable#` is set.
|
|
|
|
--
|
2021-01-05 10:09:06 +00:00
|
|
|
[[rust-analyzer.lens.enable]]rust-analyzer.lens.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show CodeLens in Rust files.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.lens.forceCustomCommands]]rust-analyzer.lens.forceCustomCommands (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Internal config: use custom client-side commands even when the
|
|
|
|
client doesn't set the corresponding capability.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.lens.implementations.enable]]rust-analyzer.lens.implementations.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Whether to show `Implementations` lens. Only applies when
|
2021-03-09 11:43:05 +00:00
|
|
|
`#rust-analyzer.lens.enable#` is set.
|
|
|
|
--
|
2022-09-12 21:34:13 +00:00
|
|
|
[[rust-analyzer.lens.location]]rust-analyzer.lens.location (default: `"above_name"`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Where to render annotations.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.lens.references.adt.enable]]rust-analyzer.lens.references.adt.enable (default: `false`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Whether to show `References` lens for Struct, Enum, and Union.
|
|
|
|
Only applies when `#rust-analyzer.lens.enable#` is set.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-27 15:51:44 +00:00
|
|
|
[[rust-analyzer.lens.references.enumVariant.enable]]rust-analyzer.lens.references.enumVariant.enable (default: `false`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Whether to show `References` lens for Enum Variants.
|
2021-10-04 07:30:46 +00:00
|
|
|
Only applies when `#rust-analyzer.lens.enable#` is set.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.lens.references.method.enable]]rust-analyzer.lens.references.method.enable (default: `false`)::
|
2021-10-04 07:30:46 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Whether to show `Method References` lens. Only applies when
|
|
|
|
`#rust-analyzer.lens.enable#` is set.
|
|
|
|
--
|
|
|
|
[[rust-analyzer.lens.references.trait.enable]]rust-analyzer.lens.references.trait.enable (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show `References` lens for Trait.
|
2021-10-04 07:30:46 +00:00
|
|
|
Only applies when `#rust-analyzer.lens.enable#` is set.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.lens.run.enable]]rust-analyzer.lens.run.enable (default: `true`)::
|
feat: gate custom clint-side commands behind capabilities
Some features of rust-analyzer requires support for custom commands on
the client side. Specifically, hover & code lens need this.
Stock LSP doesn't have a way for the server to know which client-side
commands are available. For that reason, we historically were just
sending the commands, not worrying whether the client supports then or
not.
That's not really great though, so in this PR we add infrastructure for
the client to explicitly opt-into custom commands, via `extensions`
field of the ClientCapabilities.
To preserve backwards compatability, if the client doesn't set the
field, we assume that it does support all custom commands. In the
future, we'll start treating that case as if the client doesn't support
commands.
So, if you maintain a rust-analyzer client and implement
`rust-analyzer/runSingle` and such, please also advertise this via a
capability.
2021-07-30 16:16:33 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Whether to show `Run` lens. Only applies when
|
|
|
|
`#rust-analyzer.lens.enable#` is set.
|
feat: gate custom clint-side commands behind capabilities
Some features of rust-analyzer requires support for custom commands on
the client side. Specifically, hover & code lens need this.
Stock LSP doesn't have a way for the server to know which client-side
commands are available. For that reason, we historically were just
sending the commands, not worrying whether the client supports then or
not.
That's not really great though, so in this PR we add infrastructure for
the client to explicitly opt-into custom commands, via `extensions`
field of the ClientCapabilities.
To preserve backwards compatability, if the client doesn't set the
field, we assume that it does support all custom commands. In the
future, we'll start treating that case as if the client doesn't support
commands.
So, if you maintain a rust-analyzer client and implement
`rust-analyzer/runSingle` and such, please also advertise this via a
capability.
2021-07-30 16:16:33 +00:00
|
|
|
--
|
2021-01-05 10:09:06 +00:00
|
|
|
[[rust-analyzer.linkedProjects]]rust-analyzer.linkedProjects (default: `[]`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Disable project auto-discovery in favor of explicitly specified set
|
|
|
|
of projects.
|
|
|
|
|
|
|
|
Elements must be paths pointing to `Cargo.toml`,
|
|
|
|
`rust-project.json`, or JSON objects in `rust-project.json` format.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.lru.capacity]]rust-analyzer.lru.capacity (default: `null`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Number of syntax trees rust-analyzer keeps in memory. Defaults to 128.
|
|
|
|
--
|
2023-03-25 22:03:22 +00:00
|
|
|
[[rust-analyzer.lru.query.capacities]]rust-analyzer.lru.query.capacities (default: `{}`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Sets the LRU capacity of the specified queries.
|
|
|
|
--
|
2021-01-05 10:09:06 +00:00
|
|
|
[[rust-analyzer.notifications.cargoTomlNotFound]]rust-analyzer.notifications.cargoTomlNotFound (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to show `can't find Cargo.toml` error message.
|
|
|
|
--
|
2022-12-09 13:36:35 +00:00
|
|
|
[[rust-analyzer.numThreads]]rust-analyzer.numThreads (default: `null`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
How many worker threads in the main loop. The default `null` means to pick automatically.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.procMacro.attributes.enable]]rust-analyzer.procMacro.attributes.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Expand attribute macros. Requires `#rust-analyzer.procMacro.enable#` to be set.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.procMacro.enable]]rust-analyzer.procMacro.enable (default: `true`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-29 13:48:48 +00:00
|
|
|
Enable support for procedural macros, implies `#rust-analyzer.cargo.buildScripts.enable#`.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-01-06 12:44:21 +00:00
|
|
|
[[rust-analyzer.procMacro.ignored]]rust-analyzer.procMacro.ignored (default: `{}`)::
|
2022-01-05 18:35:48 +00:00
|
|
|
+
|
|
|
|
--
|
2022-01-06 12:44:21 +00:00
|
|
|
These proc-macros will be ignored when trying to expand them.
|
|
|
|
|
|
|
|
This config takes a map of crate names with the exported proc-macro names to ignore as values.
|
2022-01-05 18:35:48 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.procMacro.server]]rust-analyzer.procMacro.server (default: `null`)::
|
|
|
|
+
|
|
|
|
--
|
2023-04-26 06:06:15 +00:00
|
|
|
Internal config, path to proc-macro server executable.
|
2022-04-26 12:39:06 +00:00
|
|
|
--
|
2022-09-09 17:58:06 +00:00
|
|
|
[[rust-analyzer.references.excludeImports]]rust-analyzer.references.excludeImports (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Exclude imports from find-all-references.
|
|
|
|
--
|
2024-01-18 11:09:23 +00:00
|
|
|
[[rust-analyzer.rename.allowExternalItems]]rust-analyzer.rename.allowExternalItems (default: `false`)::
|
2024-01-17 17:02:41 +00:00
|
|
|
+
|
|
|
|
--
|
2024-01-18 11:09:23 +00:00
|
|
|
Allow renaming of items not belonging to the loaded workspaces.
|
2024-01-17 17:02:41 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.runnables.command]]rust-analyzer.runnables.command (default: `null`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Command to be executed instead of 'cargo' for runnables.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.runnables.extraArgs]]rust-analyzer.runnables.extraArgs (default: `[]`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Additional arguments to be passed to cargo for runnables such as
|
|
|
|
tests or binaries. For example, it may be `--release`.
|
|
|
|
--
|
2023-09-29 08:49:37 +00:00
|
|
|
[[rust-analyzer.rust.analyzerTargetDir]]rust-analyzer.rust.analyzerTargetDir (default: `null`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Optional path to a rust-analyzer specific target directory.
|
2023-10-09 07:14:46 +00:00
|
|
|
This prevents rust-analyzer's `cargo check` from locking the `Cargo.lock`
|
|
|
|
at the expense of duplicating build artifacts.
|
2023-09-29 08:49:37 +00:00
|
|
|
|
|
|
|
Set to `true` to use a subdirectory of the existing target directory or
|
2023-10-01 02:21:00 +00:00
|
|
|
set to a path relative to the workspace to use that path.
|
2023-09-29 08:49:37 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.rustc.source]]rust-analyzer.rustc.source (default: `null`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Path to the Cargo.toml of the rust compiler workspace, for usage in rustc_private
|
2021-10-14 05:49:22 +00:00
|
|
|
projects, or "discover" to try to automatically find it if the `rustc-dev` component
|
|
|
|
is installed.
|
2021-03-09 11:43:05 +00:00
|
|
|
|
|
|
|
Any project which uses rust-analyzer with the rustcPrivate
|
|
|
|
crates must set `[package.metadata.rust-analyzer] rustc_private=true` to use it.
|
|
|
|
|
2021-10-14 05:49:22 +00:00
|
|
|
This option does not take effect until rust-analyzer is restarted.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2021-01-05 10:09:06 +00:00
|
|
|
[[rust-analyzer.rustfmt.extraArgs]]rust-analyzer.rustfmt.extraArgs (default: `[]`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Additional arguments to `rustfmt`.
|
|
|
|
--
|
2021-01-05 10:09:06 +00:00
|
|
|
[[rust-analyzer.rustfmt.overrideCommand]]rust-analyzer.rustfmt.overrideCommand (default: `null`)::
|
2021-03-09 11:43:05 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Advanced option, fully override the command rust-analyzer uses for
|
2023-02-21 10:22:38 +00:00
|
|
|
formatting. This should be the equivalent of `rustfmt` here, and
|
|
|
|
not that of `cargo fmt`. The file contents will be passed on the
|
|
|
|
standard input and the formatted result will be read from the
|
|
|
|
standard output.
|
2021-03-09 11:43:05 +00:00
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.rustfmt.rangeFormatting.enable]]rust-analyzer.rustfmt.rangeFormatting.enable (default: `false`)::
|
2021-05-04 21:13:51 +00:00
|
|
|
+
|
|
|
|
--
|
|
|
|
Enables the use of rustfmt's unstable range formatting command for the
|
|
|
|
`textDocument/rangeFormatting` request. The rustfmt option is unstable and only
|
|
|
|
available on a nightly build.
|
|
|
|
--
|
2022-08-22 12:15:09 +00:00
|
|
|
[[rust-analyzer.semanticHighlighting.doc.comment.inject.enable]]rust-analyzer.semanticHighlighting.doc.comment.inject.enable (default: `true`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Inject additional highlighting into doc comments.
|
|
|
|
|
|
|
|
When enabled, rust-analyzer will highlight rust source in doc comments as well as intra
|
|
|
|
doc links.
|
|
|
|
--
|
2023-05-11 07:55:30 +00:00
|
|
|
[[rust-analyzer.semanticHighlighting.nonStandardTokens]]rust-analyzer.semanticHighlighting.nonStandardTokens (default: `true`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether the server is allowed to emit non-standard tokens and modifiers.
|
|
|
|
--
|
2022-08-22 12:15:09 +00:00
|
|
|
[[rust-analyzer.semanticHighlighting.operator.enable]]rust-analyzer.semanticHighlighting.operator.enable (default: `true`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Use semantic tokens for operators.
|
|
|
|
|
|
|
|
When disabled, rust-analyzer will emit semantic tokens only for operator tokens when
|
|
|
|
they are tagged with modifiers.
|
|
|
|
--
|
|
|
|
[[rust-analyzer.semanticHighlighting.operator.specialization.enable]]rust-analyzer.semanticHighlighting.operator.specialization.enable (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Use specialized semantic tokens for operators.
|
|
|
|
|
|
|
|
When enabled, rust-analyzer will emit special token types for operator tokens instead
|
|
|
|
of the generic `operator` token type.
|
|
|
|
--
|
|
|
|
[[rust-analyzer.semanticHighlighting.punctuation.enable]]rust-analyzer.semanticHighlighting.punctuation.enable (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
2023-04-13 22:35:00 +00:00
|
|
|
Use semantic tokens for punctuation.
|
2022-08-22 12:15:09 +00:00
|
|
|
|
|
|
|
When disabled, rust-analyzer will emit semantic tokens only for punctuation tokens when
|
|
|
|
they are tagged with modifiers or have a special role.
|
|
|
|
--
|
|
|
|
[[rust-analyzer.semanticHighlighting.punctuation.separate.macro.bang]]rust-analyzer.semanticHighlighting.punctuation.separate.macro.bang (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
When enabled, rust-analyzer will emit a punctuation semantic token for the `!` of macro
|
|
|
|
calls.
|
|
|
|
--
|
|
|
|
[[rust-analyzer.semanticHighlighting.punctuation.specialization.enable]]rust-analyzer.semanticHighlighting.punctuation.specialization.enable (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
2023-04-13 22:35:00 +00:00
|
|
|
Use specialized semantic tokens for punctuation.
|
2022-08-22 12:15:09 +00:00
|
|
|
|
|
|
|
When enabled, rust-analyzer will emit special token types for punctuation tokens instead
|
|
|
|
of the generic `punctuation` token type.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.semanticHighlighting.strings.enable]]rust-analyzer.semanticHighlighting.strings.enable (default: `true`)::
|
2021-02-23 12:03:31 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
Use semantic tokens for strings.
|
|
|
|
|
|
|
|
In some editors (e.g. vscode) semantic tokens override other highlighting grammars.
|
|
|
|
By disabling semantic tokens for strings, other grammars can be used to highlight
|
|
|
|
their contents.
|
|
|
|
--
|
2022-04-27 15:51:44 +00:00
|
|
|
[[rust-analyzer.signatureInfo.detail]]rust-analyzer.signatureInfo.detail (default: `"full"`)::
|
2022-04-26 12:39:06 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-27 15:51:44 +00:00
|
|
|
Show full signature of the callable. Only shows parameters if disabled.
|
2022-04-26 12:39:06 +00:00
|
|
|
--
|
2022-04-27 15:51:44 +00:00
|
|
|
[[rust-analyzer.signatureInfo.documentation.enable]]rust-analyzer.signatureInfo.documentation.enable (default: `true`)::
|
2022-04-26 12:39:06 +00:00
|
|
|
+
|
|
|
|
--
|
2022-04-27 15:51:44 +00:00
|
|
|
Show documentation.
|
2021-02-23 12:03:31 +00:00
|
|
|
--
|
2022-05-25 10:15:36 +00:00
|
|
|
[[rust-analyzer.typing.autoClosingAngleBrackets.enable]]rust-analyzer.typing.autoClosingAngleBrackets.enable (default: `false`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Whether to insert closing angle brackets when typing an opening angle bracket of a generic argument list.
|
|
|
|
--
|
2021-02-23 12:03:31 +00:00
|
|
|
[[rust-analyzer.workspace.symbol.search.kind]]rust-analyzer.workspace.symbol.search.kind (default: `"only_types"`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Workspace symbol search kind.
|
|
|
|
--
|
2021-11-18 16:30:36 +00:00
|
|
|
[[rust-analyzer.workspace.symbol.search.limit]]rust-analyzer.workspace.symbol.search.limit (default: `128`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Limits the number of items returned from a workspace symbol search (Defaults to 128).
|
|
|
|
Some clients like vs-code issue new searches on result filtering and don't require all results to be returned in the initial search.
|
|
|
|
Other clients requires all results upfront and might require a higher limit.
|
|
|
|
--
|
2022-04-26 12:39:06 +00:00
|
|
|
[[rust-analyzer.workspace.symbol.search.scope]]rust-analyzer.workspace.symbol.search.scope (default: `"workspace"`)::
|
|
|
|
+
|
|
|
|
--
|
|
|
|
Workspace symbol search scope.
|
|
|
|
--
|