mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
vscode: fix extraEnv handling numeric values
This commit is contained in:
parent
7be85a5b4a
commit
d1aa6d3216
@ -308,6 +308,9 @@
|
|||||||
"null",
|
"null",
|
||||||
"object"
|
"object"
|
||||||
],
|
],
|
||||||
|
"additionalProperties": {
|
||||||
|
"type": ["string", "number"]
|
||||||
|
},
|
||||||
"default": null,
|
"default": null,
|
||||||
"markdownDescription": "Extra environment variables that will be passed to the rust-analyzer executable. Useful for passing e.g. `RA_LOG` for debugging."
|
"markdownDescription": "Extra environment variables that will be passed to the rust-analyzer executable. Useful for passing e.g. `RA_LOG` for debugging."
|
||||||
},
|
},
|
||||||
|
@ -100,8 +100,9 @@ export class Config {
|
|||||||
get serverPath() {
|
get serverPath() {
|
||||||
return this.get<null | string>("server.path") ?? this.get<null | string>("serverPath");
|
return this.get<null | string>("server.path") ?? this.get<null | string>("serverPath");
|
||||||
}
|
}
|
||||||
get serverExtraEnv() {
|
get serverExtraEnv(): Env {
|
||||||
return this.get<Env | null>("server.extraEnv") ?? {};
|
const extraEnv = this.get<{[key: string]: string | number} | null>("server.extraEnv") ?? {};
|
||||||
|
return Object.fromEntries(Object.entries(extraEnv).map(([k, v]) => [k, typeof v !== "string" ? v.toString(): v]));
|
||||||
}
|
}
|
||||||
get traceExtension() {
|
get traceExtension() {
|
||||||
return this.get<boolean>("trace.extension");
|
return this.get<boolean>("trace.extension");
|
||||||
|
Loading…
Reference in New Issue
Block a user