about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-10-16 09:20:38 +0000
committerbors <bors@rust-lang.org>2022-10-16 09:20:38 +0000
commitc09151c61934edd3cc685263f2955a76d168b644 (patch)
treeec11d74275bb48b8bcad27ba0d5b28e2af0bf107
parent8267966180d0ea7fbdf1c49e0054c6abc64e2efc (diff)
parent58e5452a9bd6adef56e7099b21862985c4c0151c (diff)
downloadrust-c09151c61934edd3cc685263f2955a76d168b644.tar.gz
rust-c09151c61934edd3cc685263f2955a76d168b644.zip
Auto merge of #13402 - HKalbasi:patch-1, r=Veykril
Cast runnableEnv items to string

fix #13390

An alternative approach could be raising an error if there is non string values.
-rw-r--r--editors/code/src/config.ts16
1 files changed, 15 insertions, 1 deletions
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts
index a9c0f079b3d..15846a5e864 100644
--- a/editors/code/src/config.ts
+++ b/editors/code/src/config.ts
@@ -133,7 +133,21 @@ export class Config {
     }
 
     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() {