plugins.rust-tools.server.cargo.buildScripts.enable

Run build scripts (build.rs) for more precise code analysis.

default:

true

Type: null or boolean

Default: null

Declared by:

plugins.rust-tools.server.cargo.buildScripts.invocationLocation

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.

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.cargo.buildScripts.invocationStrategy

Specifies the invocation strategy to use when running the build scripts 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.cargo.buildScripts.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.cargo.buildScripts.overrideCommand

Override the command rust-analyzer uses to run build scripts and build procedural macros. The command is required to output json and should therefore include --message-format=json or a similar option.

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

By default, a cargo invocation will be constructed for the configured targets and features, with the following base command line:

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

.

default:

null

Type: null or null or (list of string)

Default: null

Declared by:

plugins.rust-tools.server.cargo.buildScripts.rebuildOnSave

Rerun proc-macros building/build-scripts running when proc-macro or build-script sources change and are saved.

default:

true

Type: null or boolean

Default: null

Declared by:

plugins.rust-tools.server.cargo.buildScripts.useRustcWrapper

Use RUSTC_WRAPPER=rust-analyzer when running build scripts to avoid checking unnecessary things.

default:

true

Type: null or boolean

Default: null

Declared by: