mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 11:31:15 +00:00
Merge #4669
4669: Always derive from `process.env` when spawning a child process/shell execution r=matklad a=Dfinity-Alin This is useful when an extension (e.g. [Nix Environment Selector](https://marketplace.visualstudio.com/items?itemName=arrterian.nix-env-selector)) or [launch configuration](https://stackoverflow.com/questions/57641460/set-env-var-for-node-js-when-launching-through-vs-code) sets one or more environment variables. When `env` is not explicitly specified in the options passed to `child_process.spawn()` or `vscode.ShellExecution()`, then `process.env` gets applied automatically. But when an explicit `env` is set, it should inherit from `process.env` rather than replace it completely. Co-authored-by: Alin Sinpalean <alin.sinpalean@dfinity.org>
This commit is contained in:
commit
9feb15e6a2
@ -177,7 +177,7 @@ export function createTask(spec: ra.Runnable): vscode.Task {
|
||||
label: spec.label,
|
||||
command: spec.bin,
|
||||
args: spec.extraArgs ? [...spec.args, '--', ...spec.extraArgs] : spec.args,
|
||||
env: spec.env,
|
||||
env: Object.assign({}, process.env, spec.env),
|
||||
};
|
||||
|
||||
const execOption: vscode.ShellExecutionOptions = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user