plugins.rust-tools.server.cargo.allTargets

Pass --all-targets to cargo invocation.

Type: null or boolean

Default: null

Plugin default: true

Declared by:

plugins.rust-tools.server.cargo.autoreload

Automatically refresh project info via cargo metadata on Cargo.toml or .cargo/config.toml changes.

Type: null or boolean

Default: null

Plugin default: true

Declared by:

plugins.rust-tools.server.cargo.cfgs

List of cfg options to enable with the given values.

Type: null or (attribute set of anything)

Default: null

Plugin default:

{
  debug_assertions = null;
  miri = null;
}

Declared by:

plugins.rust-tools.server.cargo.extraArgs

Extra arguments that are passed to every cargo invocation.

Type: null or (list of string)

Default: null

Plugin default: [ ]

Declared by:

plugins.rust-tools.server.cargo.extraEnv

Extra environment variables that will be set when running cargo, rustc or other commands within the workspace. Useful for setting RUSTFLAGS.

Type: null or (attribute set of anything)

Default: null

Plugin default: { }

Declared by:

plugins.rust-tools.server.cargo.features

List of features to activate.

Set this to "all" to pass --all-features to cargo.

Values:

  • all: Pass --all-features to cargo

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

Default: null

Plugin default: [ ]

Declared by:

plugins.rust-tools.server.cargo.noDefaultFeatures

Whether to pass --no-default-features to cargo.

Type: null or boolean

Default: null

Plugin default: false

Declared by:

plugins.rust-tools.server.cargo.sysroot

Relative path to the sysroot, or “discover” to try to automatically find it via “rustc --print sysroot”.

Unsetting this disables sysroot loading.

This option does not take effect until rust-analyzer is restarted.

Type: null or string

Default: null

Plugin default: "discover"

Declared by:

plugins.rust-tools.server.cargo.sysrootQueryMetadata

How to query metadata for the sysroot crate. Using cargo metadata allows rust-analyzer to analyze third-party dependencies of the standard libraries.

Values:

  • none: Do not query sysroot metadata, always use stitched sysroot.
  • cargo_metadata: Use cargo metadata to query sysroot metadata.

Type: null or one of “none”, “cargo_metadata”

Default: null

Plugin default: "cargo_metadata"

Declared by:

plugins.rust-tools.server.cargo.sysrootSrc

Relative path to the sysroot library sources. If left unset, this will default to {cargo.sysroot}/lib/rustlib/src/rust/library.

This option does not take effect until rust-analyzer is restarted.

Type: null or string

Default: null

Plugin default: null

Declared by:

plugins.rust-tools.server.cargo.target

Compilation target override (target triple).

Type: null or string

Default: null

Plugin default: null

Declared by:

plugins.rust-tools.server.cargo.targetDir

Optional path to a rust-analyzer specific target directory. This prevents rust-analyzer’s cargo check and initial build-script and proc-macro building from locking the Cargo.lock at the expense of duplicating build artifacts.

Set to true to use a subdirectory of the existing target directory or set to a path relative to the workspace to use that path.

Type: null or boolean or string

Default: null

Plugin default: null

Declared by: