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": {
"type": "object",
"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);
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:");