/// Configuration for runnable items, such as `main` function or tests.
#[derive(Debug, Clone, Default)]
pub struct RunnablesConfig {
- /// Stuff to be inserted before `cargo`, e.g. `RUST_LOG=info`.
- pub cargo_prefix: Vec<String>,
+ /// Custom command to be executed instead of `cargo` for runnables.
+ pub override_cargo: Option<String>,
/// Additional arguments for the `cargo`, e.g. `--release`.
pub cargo_extra_args: Vec<String>,
}
target: data.cargo_target.clone(),
};
self.runnables = RunnablesConfig {
- cargo_prefix: data.runnables_cargoPrefix,
+ override_cargo: data.runnables_overrideCargo,
cargo_extra_args: data.runnables_cargoExtraArgs,
};
notifications_cargoTomlNotFound: bool = true,
procMacro_enable: bool = false,
- runnables_cargoPrefix: Vec<String> = Vec::new(),
- runnables_cargoExtraArgs: Vec<String> = Vec::new(),
+ runnables_overrideCargo: Option<String> = None,
+ runnables_cargoExtraArgs: Vec<String> = Vec::new(),
rustfmt_extraArgs: Vec<String> = Vec::new(),
rustfmt_overrideCommand: Option<Vec<String>> = None,
kind: lsp_ext::RunnableKind::Cargo,
args: lsp_ext::CargoRunnable {
workspace_root: Some(spec.workspace_root.clone().into()),
- cargo_prefix: config.cargo_prefix.clone(),
+ override_cargo: config.override_cargo.clone(),
cargo_args: vec![
cmd.to_string(),
"--package".to_string(),
kind: lsp_ext::RunnableKind::Cargo,
args: lsp_ext::CargoRunnable {
workspace_root: None,
- cargo_prefix: config.cargo_prefix.clone(),
+ override_cargo: config.override_cargo.clone(),
cargo_args: vec!["check".to_string(), "--workspace".to_string()],
cargo_extra_args: config.cargo_extra_args.clone(),
executable_args: Vec::new(),
#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct CargoRunnable {
- // stuff before `cargo` command, e.g. `RUST_LOG=info`
- pub cargo_prefix: Vec<String>,
+ // command to be executed instead of cargo
+ pub override_cargo: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub workspace_root: Option<PathBuf>,
// command, --package and --lib stuff
kind: lsp_ext::RunnableKind::Cargo,
args: lsp_ext::CargoRunnable {
workspace_root: workspace_root.map(|it| it.into()),
- cargo_prefix: config.cargo_prefix.clone(),
+ override_cargo: config.override_cargo.clone(),
cargo_args,
cargo_extra_args: config.cargo_extra_args.clone(),
executable_args,