mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Missing runnable env on debug target
Fix bug in Rust Analyzer where runnable debugging did not pass environment variable from configuration to child process of Cargo on binary build stage
This commit is contained in:
parent
17e31b7d3b
commit
fb9a1dd87e
2 changed files with 12 additions and 4 deletions
|
@ -18,7 +18,11 @@ export interface ArtifactSpec {
|
|||
}
|
||||
|
||||
export class Cargo {
|
||||
constructor(readonly rootFolder: string, readonly output: vscode.OutputChannel) {}
|
||||
constructor(
|
||||
readonly rootFolder: string,
|
||||
readonly output: vscode.OutputChannel,
|
||||
readonly env: Record<string, string>
|
||||
) {}
|
||||
|
||||
// Made public for testing purposes
|
||||
static artifactSpec(args: readonly string[]): ArtifactSpec {
|
||||
|
@ -102,6 +106,7 @@ export class Cargo {
|
|||
const cargo = cp.spawn(path, cargoArgs, {
|
||||
stdio: ["ignore", "pipe", "pipe"],
|
||||
cwd: this.rootFolder,
|
||||
env: this.env,
|
||||
});
|
||||
|
||||
cargo.on("error", (err) => reject(new Error(`could not launch cargo: ${err}`)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue