Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'editors/code/src/ctx.ts')
| -rw-r--r-- | editors/code/src/ctx.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts index 1149523622..e55754fb9f 100644 --- a/editors/code/src/ctx.ts +++ b/editors/code/src/ctx.ts @@ -213,7 +213,14 @@ export class Ctx implements RustAnalyzerExtensionApi { this.refreshServerStatus(); }, ); - const newEnv = Object.assign({}, process.env, this.config.serverExtraEnv); + const newEnv = { ...process.env }; + for (const [k, v] of Object.entries(this.config.serverExtraEnv)) { + if (v) { + newEnv[k] = v; + } else if (k in newEnv) { + delete newEnv[k]; + } + } const run: lc.Executable = { command: this._serverPath, options: { env: newEnv }, |