mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Add dedicated target_dir
field to CargoConfig
and FlycheckConfig
Add dedicated field for `target_dir` in the configurations for Cargo and Flycheck. Also change the directory to be a `PathBuf` as opposed to a `String` to be more appropriate to the operating system.
This commit is contained in:
parent
aeef7b644b
commit
53b6700594
4 changed files with 54 additions and 68 deletions
|
@ -50,6 +50,7 @@ pub enum FlycheckConfig {
|
|||
extra_args: Vec<String>,
|
||||
extra_env: FxHashMap<String, String>,
|
||||
ansi_color_output: bool,
|
||||
target_dir: Option<PathBuf>,
|
||||
},
|
||||
CustomCommand {
|
||||
command: String,
|
||||
|
@ -308,6 +309,7 @@ impl FlycheckActor {
|
|||
features,
|
||||
extra_env,
|
||||
ansi_color_output,
|
||||
target_dir,
|
||||
} => {
|
||||
let mut cmd = Command::new(toolchain::cargo());
|
||||
cmd.arg(command);
|
||||
|
@ -340,6 +342,9 @@ impl FlycheckActor {
|
|||
cmd.arg(features.join(" "));
|
||||
}
|
||||
}
|
||||
if let Some(target_dir) = target_dir {
|
||||
cmd.arg("--target-dir").arg(target_dir);
|
||||
}
|
||||
cmd.envs(extra_env);
|
||||
(cmd, extra_args)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue