Add separate settings for each debug engine.

This commit is contained in:
vsrs 2020-05-07 18:35:48 +03:00
parent 5426e2927e
commit 435a17ecd8
2 changed files with 8 additions and 5 deletions

View file

@ -427,7 +427,7 @@
"rust-analyzer.debug.engineSettings": { "rust-analyzer.debug.engineSettings": {
"type": "object", "type": "object",
"default": {}, "default": {},
"description": "Optional settings passed to the debug engine." "description": "Optional settings passed to the debug engine. Example:\n{ \"lldb\": { \"terminal\":\"external\"} }"
} }
} }
}, },
@ -609,4 +609,4 @@
} }
] ]
} }
} }

View file

@ -134,9 +134,12 @@ export function debugSingle(ctx: Ctx): Cmd {
} }
const executable = await getDebugExecutable(config); const executable = await getDebugExecutable(config);
let debugConfig = knownEngines[debugEngine.id](config, executable, debugOptions.sourceFileMap); const debugConfig = knownEngines[debugEngine.id](config, executable, debugOptions.sourceFileMap);
for (var key in debugOptions.engineSettings) { if (debugConfig.type in debugOptions.engineSettings) {
debugConfig[key] = (debugOptions.engineSettings as any)[key]; const settingsMap = (debugOptions.engineSettings as any)[debugConfig.type];
for (var key in settingsMap) {
debugConfig[key] = settingsMap[key];
}
} }
debugOutput.appendLine("Launching debug configuration:"); debugOutput.appendLine("Launching debug configuration:");