mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-14 22:24:14 +00:00
Cast runnableEnv items to string
This commit is contained in:
parent
a0ab61fb6c
commit
983ae1b1c9
1 changed files with 15 additions and 1 deletions
|
@ -133,7 +133,21 @@ export class Config {
|
||||||
}
|
}
|
||||||
|
|
||||||
get runnableEnv() {
|
get runnableEnv() {
|
||||||
return this.get<RunnableEnvCfg>("runnableEnv");
|
const item = this.get<any>("runnableEnv");
|
||||||
|
if (!item) return item;
|
||||||
|
const fixRecord = (r: Record<string, any>) => {
|
||||||
|
for (const key in r) {
|
||||||
|
if (typeof r[key] !== 'string') {
|
||||||
|
r[key] = String(r[key]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (item instanceof Array) {
|
||||||
|
item.forEach((x) => fixRecord(x.env));
|
||||||
|
} else {
|
||||||
|
fixRecord(item);
|
||||||
|
}
|
||||||
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
get restartServerOnConfigChange() {
|
get restartServerOnConfigChange() {
|
||||||
|
|
Loading…
Reference in a new issue