fix(debug): preserve DAP default argument overrides
This commit is contained in:
@@ -87,7 +87,22 @@ function mergeAdapters(
|
||||
): Record<string, DapAdapterConfig> {
|
||||
const merged: Record<string, DapAdapterConfig> = { ...base };
|
||||
for (const [name, config] of Object.entries(overrides)) {
|
||||
const candidate = isRecord(merged[name]) && isRecord(config) ? { ...merged[name], ...config } : config;
|
||||
const existing = merged[name];
|
||||
const candidate =
|
||||
isRecord(existing) && isRecord(config)
|
||||
? {
|
||||
...existing,
|
||||
...config,
|
||||
launchDefaults:
|
||||
isRecord(existing.launchDefaults) || isRecord(config.launchDefaults)
|
||||
? { ...existing.launchDefaults, ...normalizeObject(config.launchDefaults) }
|
||||
: undefined,
|
||||
attachDefaults:
|
||||
isRecord(existing.attachDefaults) || isRecord(config.attachDefaults)
|
||||
? { ...existing.attachDefaults, ...normalizeObject(config.attachDefaults) }
|
||||
: undefined,
|
||||
}
|
||||
: config;
|
||||
const normalized = normalizeAdapterConfig(candidate);
|
||||
if (normalized) {
|
||||
merged[name] = normalized;
|
||||
|
||||
@@ -62,7 +62,7 @@ describe("DAP adapter configuration", () => {
|
||||
adapters: {
|
||||
debugpy: {
|
||||
args: ["-m", "debugpy.adapter", "--log-dir", ".debugpy-logs"],
|
||||
launchDefaults: { request: "launch", justMyCode: false },
|
||||
launchDefaults: { justMyCode: false },
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user