From b54dc548a4b9d86fea67852dbe5f8755e5f3e6e7 Mon Sep 17 00:00:00 2001 From: PBDm Date: Fri, 20 Mar 2020 18:30:37 +0800 Subject: [PATCH] support custom debug config for both lldb and other types --- package.json | 4 +--- src/debugger.ts | 13 +++++++------ 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index eae1319..f4d523d 100644 --- a/package.json +++ b/package.json @@ -338,9 +338,7 @@ }, "xmake.customDebugConfig": { "type": "object", - "default": { - "type": "cppdbg" - }, + "default": {}, "description": "The Custom Debugging Configurations when xmake.debugConfigType is custom" } } diff --git a/src/debugger.ts b/src/debugger.ts index 0a9da72..ffe06fb 100644 --- a/src/debugger.ts +++ b/src/debugger.ts @@ -108,14 +108,15 @@ export class Debugger implements vscode.Disposable { }; } - if (config.debugConfigType == "custom") { - var customcfg = config.customDebugConfig; - for (let key in customcfg) { - debugConfig[key] = customcfg[key]; - } - } } + var customcfg = config.customDebugConfig; + for (let key in customcfg) { + debugConfig[key] = customcfg[key]; + } + // default type if not set yet + debugConfig.type = debugConfig.type || 'cppdbg'; + // start debugging if (debugConfig) { await vscode.debug.startDebugging(vscode.workspace.workspaceFolders[0], debugConfig);