Skip to content

Commit 435a17e

Browse files
committed
Add separate settings for each debug engine.
1 parent 5426e29 commit 435a17e

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

editors/code/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@
427427
"rust-analyzer.debug.engineSettings": {
428428
"type": "object",
429429
"default": {},
430-
"description": "Optional settings passed to the debug engine."
430+
"description": "Optional settings passed to the debug engine. Example:\n{ \"lldb\": { \"terminal\":\"external\"} }"
431431
}
432432
}
433433
},
@@ -609,4 +609,4 @@
609609
}
610610
]
611611
}
612-
}
612+
}

editors/code/src/commands/runnables.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,12 @@ export function debugSingle(ctx: Ctx): Cmd {
134134
}
135135

136136
const executable = await getDebugExecutable(config);
137-
let debugConfig = knownEngines[debugEngine.id](config, executable, debugOptions.sourceFileMap);
138-
for (var key in debugOptions.engineSettings) {
139-
debugConfig[key] = (debugOptions.engineSettings as any)[key];
137+
const debugConfig = knownEngines[debugEngine.id](config, executable, debugOptions.sourceFileMap);
138+
if (debugConfig.type in debugOptions.engineSettings) {
139+
const settingsMap = (debugOptions.engineSettings as any)[debugConfig.type];
140+
for (var key in settingsMap) {
141+
debugConfig[key] = settingsMap[key];
142+
}
140143
}
141144

142145
debugOutput.appendLine("Launching debug configuration:");

0 commit comments

Comments
 (0)