Skip to content

Commit 51d3d63

Browse files
Copilotdbaeumer
andauthored
Fix LanguageClient.start() mutating serverOptions, erasing .env on restart (#1722)
* Initial plan * Fix serverOptions mutation by shallow-copying node.options before mutating Co-authored-by: dbaeumer <1931590+dbaeumer@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: dbaeumer <1931590+dbaeumer@users.noreply.github.com>
1 parent d6bfeef commit 51d3d63

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

client/src/node/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ export class LanguageClient extends BaseLanguageClient {
424424
args.push(`--socket=${transport.port}`);
425425
}
426426
args.push(`--clientProcessId=${process.pid.toString()}`);
427-
const options: cp.ForkOptions = node.options ?? Object.create(null);
427+
const options: cp.ForkOptions = node.options ? { ...node.options } : Object.create(null);
428428
options.env = getEnvironment(options.env, true);
429429
options.execArgv = options.execArgv || [];
430430
options.cwd = serverWorkingDir;

package-lock.json

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)