]> git.lizzy.rs Git - rust.git/commitdiff
Add separate settings for each debug engine.
authorvsrs <vit@conrlab.com>
Thu, 7 May 2020 15:35:48 +0000 (18:35 +0300)
committervsrs <vit@conrlab.com>
Thu, 7 May 2020 15:35:48 +0000 (18:35 +0300)
editors/code/package.json
editors/code/src/commands/runnables.ts

index 84aea8249e64ba0e37edc7212a8d6868aa5e86ec..e4dd66924482fbb387a74173393298a93d75f8c6 100644 (file)
                 "rust-analyzer.debug.engineSettings": {
                     "type": "object",
                     "default": {},
-                    "description": "Optional settings passed to the debug engine."
+                    "description": "Optional settings passed to the debug engine. Example:\n{ \"lldb\": { \"terminal\":\"external\"} }"
                 }
             }
         },
             }
         ]
     }
-}
+}
\ No newline at end of file
index 782a7ba8920f85f791eec165c90c0197a7e53fc5..e62de7d6ede601d3489b7ef9aa62635018fb904e 100644 (file)
@@ -134,9 +134,12 @@ export function debugSingle(ctx: Ctx): Cmd {
         }
 
         const executable = await getDebugExecutable(config);
-        let debugConfig = knownEngines[debugEngine.id](config, executable, debugOptions.sourceFileMap);
-        for (var key in debugOptions.engineSettings) {
-            debugConfig[key] = (debugOptions.engineSettings as any)[key];
+        const debugConfig = knownEngines[debugEngine.id](config, executable, debugOptions.sourceFileMap);
+        if (debugConfig.type in debugOptions.engineSettings) {
+            const settingsMap = (debugOptions.engineSettings as any)[debugConfig.type];
+            for (var key in settingsMap) {
+                debugConfig[key] = settingsMap[key];
+            }
         }
 
         debugOutput.appendLine("Launching debug configuration:");