mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-05 21:24:12 +00:00
Replace 'cargo_prefix' option with 'override_cargo'
This commit is contained in:
parent
2c125f3c63
commit
4a1b4b23bb
@ -128,8 +128,8 @@ pub enum RustfmtConfig {
|
||||
/// 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>,
|
||||
}
|
||||
@ -232,7 +232,7 @@ impl Config {
|
||||
target: data.cargo_target.clone(),
|
||||
};
|
||||
self.runnables = RunnablesConfig {
|
||||
cargo_prefix: data.runnables_cargoPrefix,
|
||||
override_cargo: data.runnables_overrideCargo,
|
||||
cargo_extra_args: data.runnables_cargoExtraArgs,
|
||||
};
|
||||
|
||||
@ -489,8 +489,8 @@ config_data! {
|
||||
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,
|
||||
|
@ -501,7 +501,7 @@ pub(crate) fn handle_runnables(
|
||||
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(),
|
||||
@ -522,7 +522,7 @@ pub(crate) fn handle_runnables(
|
||||
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(),
|
||||
|
@ -171,8 +171,8 @@ pub enum RunnableKind {
|
||||
#[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
|
||||
|
@ -755,7 +755,7 @@ pub(crate) fn runnable(
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user