mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
Set CARGO_TARGET_DIR
when using Flycheck custom command
This commit is contained in:
parent
ef0b3bbef1
commit
3682c3791b
2 changed files with 9 additions and 1 deletions
|
@ -58,6 +58,7 @@ pub enum FlycheckConfig {
|
|||
extra_env: FxHashMap<String, String>,
|
||||
invocation_strategy: InvocationStrategy,
|
||||
invocation_location: InvocationLocation,
|
||||
target_dir: Option<PathBuf>,
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -354,10 +355,15 @@ impl FlycheckActor {
|
|||
extra_env,
|
||||
invocation_strategy,
|
||||
invocation_location,
|
||||
target_dir,
|
||||
} => {
|
||||
let mut cmd = Command::new(command);
|
||||
cmd.envs(extra_env);
|
||||
|
||||
if let Some(target_dir) = target_dir {
|
||||
cmd.env("CARGO_TARGET_DIR", target_dir);
|
||||
}
|
||||
|
||||
match invocation_location {
|
||||
InvocationLocation::Workspace => {
|
||||
match invocation_strategy {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue