From 435a17ecd8806f3ae81edf6277c17363b01f4334 Mon Sep 17 00:00:00 2001 From: vsrs Date: Thu, 7 May 2020 18:35:48 +0300 Subject: Add separate settings for each debug engine. --- editors/code/package.json | 4 ++-- editors/code/src/commands/runnables.ts | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'editors') diff --git a/editors/code/package.json b/editors/code/package.json index 84aea8249..e4dd66924 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -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 @@ } ] } -} +} \ No newline at end of file diff --git a/editors/code/src/commands/runnables.ts b/editors/code/src/commands/runnables.ts index 782a7ba89..e62de7d6e 100644 --- a/editors/code/src/commands/runnables.ts +++ b/editors/code/src/commands/runnables.ts @@ -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:"); -- cgit v1.2.3