plugins.rust-tools.server.check.allTargets

Check all targets and tests (--all-targets). Defaults to #rust-analyzer.cargo.allTargets#.

default:

null

Type: null or null or boolean

Default: null

Declared by:

plugins.rust-tools.server.check.command

Cargo command to use for cargo check.

default:

"check"

Type: null or string

Default: null

Declared by:

plugins.rust-tools.server.check.extraArgs

Extra arguments for cargo check.

default:

[ ]

Type: null or (list of string)

Default: null

Declared by:

plugins.rust-tools.server.check.extraEnv

Extra environment variables that will be set when running cargo check. Extends #rust-analyzer.cargo.extraEnv#.

default:

{ }

Type: null or (attribute set of anything)

Default: null

Declared by:

plugins.rust-tools.server.check.features

List of features to activate. Defaults to #rust-analyzer.cargo.features#.

Set to "all" to pass --all-features to Cargo.

default:

null

Type: null or value “all” (singular enum) or list of string or null

Default: null

Declared by:

plugins.rust-tools.server.check.ignore

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,…

default:

[ ]

Type: null or (list of string)

Default: null

Declared by:

plugins.rust-tools.server.check.invocationLocation

Specifies the working directory for running checks.

  • “workspace”: run checks for workspaces in the corresponding workspaces’ root directories. This falls back to “root” if #rust-analyzer.check.invocationStrategy# is set to once.
  • “root”: run checks in the project’s root directory. This config only has an effect when #rust-analyzer.check.overrideCommand# is set.

Values:

  • workspace: The command will be executed in the corresponding workspace root.
  • root: The command will be executed in the project root.
"workspace"

Type: null or one of “workspace”, “root”

Default: null

Declared by:

plugins.rust-tools.server.check.invocationStrategy

Specifies the invocation strategy to use when running the check command. If per_workspace is set, the command will be executed for each workspace. If once is set, the command will be executed once. This config only has an effect when #rust-analyzer.check.overrideCommand# is set.

Values:

  • per_workspace: The command will be executed for each workspace.
  • once: The command will be executed once.
"per_workspace"

Type: null or one of “per_workspace”, “once”

Default: null

Declared by:

plugins.rust-tools.server.check.noDefaultFeatures

Whether to pass --no-default-features to Cargo. Defaults to #rust-analyzer.cargo.noDefaultFeatures#.

default:

null

Type: null or null or boolean

Default: null

Declared by:

plugins.rust-tools.server.check.overrideCommand

Override the command rust-analyzer uses instead of cargo check for diagnostics on save. The command is required to output json and should therefore include --message-format=json or a similar option (if your client supports the colorDiagnosticOutput experimental capability, you can use --message-format=json-diagnostic-rendered-ansi).

If you’re changing this because you’re using some tool wrapping Cargo, you might also want to change #rust-analyzer.cargo.buildScripts.overrideCommand#.

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.check.invocationStrategy# and #rust-analyzer.check.invocationLocation#.

If $saved_file is part of the command, rust-analyzer will pass the absolute path of the saved file to the provided command. This is intended to be used with non-Cargo build systems. Note that $saved_file is experimental and may be removed in the futureg.

An example command would be:

cargo check --workspace --message-format=json --all-targets

.

default:

null

Type: null or null or (list of string)

Default: null

Declared by:

plugins.rust-tools.server.check.targets

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".

default:

null

Type: null or null or string or list of string

Default: null

Declared by:

plugins.rust-tools.server.check.workspace

Whether --workspace should be passed to cargo check. If false, -p <package> will be passed instead.

default:

true

Type: null or boolean

Default: null

Declared by: