Skip to content

Commit

Permalink
fix: adding breakpoints on different files clearing all breakpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
ivojawer committed Sep 4, 2024
1 parent 63b4637 commit 399b75d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/debug-adapter/src/debug-session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ export class WollokDebugSession extends DebugSession {
return node.is(Package) && node.sourceFileName === args.source.path
})

// ToDo filtrar por package
this.executionDirector.breakpoints.forEach(this.executionDirector.removeBreakpoint)
this.executionDirector.breakpoints.forEach(breakpointedNode => {
if(breakpointedNode.sourceFileName === breakpointsPackage.sourceFileName) {
this.executionDirector.removeBreakpoint(breakpointedNode)
}
})

if(breakpointsPackage){
const sentences = breakpointsPackage.descendants.filter<Sentence>(function (node): node is Sentence {
Expand Down Expand Up @@ -146,9 +149,11 @@ export class WollokDebugSession extends DebugSession {

protected moveExecution(action: () => ExecutionState<unknown>, overrideStoppedReason?: string): void{
const state = action()

// reset stack state when moving execution
this.frames.clear()
this.contexts.clear()

const stoppedReason = overrideStoppedReason || (state.done ? state.error ? 'exception' : 'done' : 'breakpoint')
if(!state.done && 'next' in state) {
this.stoppedNode = state.next
Expand Down

0 comments on commit 399b75d

Please sign in to comment.