Skip to content

Commit c09151c

Browse files
committed
Auto merge of rust-lang#13402 - HKalbasi:patch-1, r=Veykril
Cast runnableEnv items to string fix rust-lang#13390 An alternative approach could be raising an error if there is non string values.
2 parents 8267966 + 58e5452 commit c09151c

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

editors/code/src/config.ts

+15-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,21 @@ export class Config {
133133
}
134134

135135
get runnableEnv() {
136-
return this.get<RunnableEnvCfg>("runnableEnv");
136+
const item = this.get<any>("runnableEnv");
137+
if (!item) return item;
138+
const fixRecord = (r: Record<string, any>) => {
139+
for (const key in r) {
140+
if (typeof r[key] !== "string") {
141+
r[key] = String(r[key]);
142+
}
143+
}
144+
};
145+
if (item instanceof Array) {
146+
item.forEach((x) => fixRecord(x.env));
147+
} else {
148+
fixRecord(item);
149+
}
150+
return item;
137151
}
138152

139153
get restartServerOnConfigChange() {

0 commit comments

Comments
 (0)