Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit d1aa6d3

Browse files
committed
vscode: fix extraEnv handling numeric values
1 parent 7be85a5 commit d1aa6d3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

editors/code/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@
308308
"null",
309309
"object"
310310
],
311+
"additionalProperties": {
312+
"type": ["string", "number"]
313+
},
311314
"default": null,
312315
"markdownDescription": "Extra environment variables that will be passed to the rust-analyzer executable. Useful for passing e.g. `RA_LOG` for debugging."
313316
},

editors/code/src/config.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ export class Config {
100100
get serverPath() {
101101
return this.get<null | string>("server.path") ?? this.get<null | string>("serverPath");
102102
}
103-
get serverExtraEnv() {
104-
return this.get<Env | null>("server.extraEnv") ?? {};
103+
get serverExtraEnv(): Env {
104+
const extraEnv = this.get<{[key: string]: string | number} | null>("server.extraEnv") ?? {};
105+
return Object.fromEntries(Object.entries(extraEnv).map(([k, v]) => [k, typeof v !== "string" ? v.toString(): v]));
105106
}
106107
get traceExtension() {
107108
return this.get<boolean>("trace.extension");

0 commit comments

Comments
 (0)