diff --git a/.vscode/settings.json b/.vscode/settings.json index 80ecdea..fc1c2f7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,4 +9,8 @@ "**/node_modules": true, ".vscode-test": true }, + "files.associations": { + "*.gafq": "lua", + "functional": "cpp" + }, } diff --git a/CHANGELOG.md b/CHANGELOG.md index 0040dd8..13e4da6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## version 2.17.5 + +- 修复 c++ 调试 断点问题 + ## version 2.17.4 - 多语言配置缺少 main.contributes.commands.lcpr.simpleDebug.title diff --git a/package.json b/package.json index 58e0290..6a2921a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-leetcode-problem-rating", "displayName": "LeetCode", "description": "%main.description%", - "version": "2.17.4", + "version": "2.17.5", "author": "ccagml", "publisher": "ccagml", "license": "MIT", diff --git a/src/debugex/debugCpp.ts b/src/debugex/debugCpp.ts index cb75038..816c133 100644 --- a/src/debugex/debugCpp.ts +++ b/src/debugex/debugCpp.ts @@ -277,6 +277,7 @@ class DebugCpp extends DebugBase { Object.assign({}, debugConfig, { request: "launch", name: debugSessionName, + logging: { engineLogging: true, trace: true, traceResponse: true }, args, }) ); @@ -315,11 +316,17 @@ class DebugCpp extends DebugBase { event.removed.map((bp: vscode.SourceBreakpoint) => { if (bp.location.uri.fsPath === filePath) { - const location: vscode.Location = new vscode.Location( - vscode.Uri.file(newSourceFilePath), - bp.location.range - ); - vscode.debug.removeBreakpoints([new vscode.SourceBreakpoint(location)]); + const aaa: vscode.Breakpoint[] = []; + vscode.debug.breakpoints.map((all_bp_one: vscode.SourceBreakpoint) => { + if ( + all_bp_one.location.uri.fsPath === newSourceFilePath && + all_bp_one.location.range.start.line == bp.location.range.start.line && + all_bp_one.location.range.end.line == bp.location.range.end.line + ) { + aaa.push(all_bp_one); + } + }); + vscode.debug.removeBreakpoints(aaa); } }); @@ -329,7 +336,17 @@ class DebugCpp extends DebugBase { vscode.Uri.file(newSourceFilePath), bp.location.range ); - vscode.debug.removeBreakpoints([new vscode.SourceBreakpoint(location)]); + const aaa: vscode.Breakpoint[] = []; + vscode.debug.breakpoints.map((all_bp_one: vscode.SourceBreakpoint) => { + if ( + all_bp_one.location.uri.fsPath === newSourceFilePath && + all_bp_one.location.range.start.line == bp.location.range.start.line && + all_bp_one.location.range.end.line == bp.location.range.end.line + ) { + aaa.push(all_bp_one); + } + }); + vscode.debug.removeBreakpoints(aaa); vscode.debug.addBreakpoints([ new vscode.SourceBreakpoint(location, bp.enabled, bp.condition, bp.hitCondition, bp.logMessage), ]);