microsoft / microsoft/vscode-mock-debug
Normal breakpoints don't get hit util exception line gets hit.
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 358
- Forks
- 200
- Avg merge
- 24d 23h
- Merged PRs (30d)
- 1
Description
I downloaded the repo,and launched the code without changing any lines,and the workspace stops at the top line ("# VS Code Mock Debug") normally,and I set the a breakpoint at line 3,then continue,but the execution doesn't stop at line 3.
I dive into the code,and see the possible reasons to cause this:
In MockRuntime class,there's a method called findNextStatement:
*/
private findNextStatement(reverse: boolean, stepEvent?: string): boolean {
for (let ln = this.currentLine; reverse ? ln >= 0 : ln < this.sourceLines.length; reverse ? ln-- : ln++) {
// is there a source breakpoint?
const breakpoints = this.breakPoints.get(this._sourceFile);
if (breakpoints) {
const bps = breakpoints.filter(bp => bp.line === ln);
...
}
...
}
}
The breakpoints will be undefined,cuz this.breakpoints holds an entry, the key of which is "c:/Code Repository/vscode-mock-debug/sampleWorkspace/readme.md",
but the _sourceFile is "C:/Code Repository/vscode-mock-debug/sampleWorkspace/readme.md" now,see what's different?
the previous one starts with a lowercase drive volume while another starts with a uppercase one,and please note that I have a space char in my workspace path.
Platform:Windows
VSCodeVersion:1.76.2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the MockRuntime.findNextStatement method and reproduce the breakpoint behavior on Windows with a workspace path containing a space. Inspect how the breakpoint map key and _sourceFile path are produced and compared; done means a normal breakpoint at line 3 is hit without requiring the exception line.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100