Skip to content

Commit

Permalink
(WIP) Call InitializedEvent after source is sent to get persisted bre…
Browse files Browse the repository at this point in the history
…akpoints (#31)

IoT.js-VSCode-DCO-1.0-Signed-off-by: Tibor Dusnoki [email protected]
  • Loading branch information
tdusnoki authored and robertsipka committed Oct 19, 2018
1 parent 8b1f6e6 commit 77c23f7
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/IotjsDebugger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ class IotjsDebugSession extends DebugSession {
.catch(error => {
this.log(error.message, LOG_LEVEL.ERROR);
this.sendErrorResponse(response, error);
})
.then(() => {
this.sendEvent(new InitializedEvent());
});
}

Expand Down Expand Up @@ -312,13 +309,13 @@ class IotjsDebugSession extends DebugSession {
}
}));

// Get the persists breakpoints.
// Get the persisted breakpoints.
const newBreakpointsLines: number[] = newBreakpoints.map(b => b.line);
const persistingBreakpoints: TemporaryBreakpoint[] = vscodeBreakpoints
.filter(b => newBreakpointsLines.indexOf(b.line) === -1)
.map(b => ({verified: true, line: b.line}));

// Get the removalbe breakpoints.
// Get the removable breakpoints.
const vscodeBreakpointsLines: number[] = vscodeBreakpoints.map(b => b.line);
const removeBps: Breakpoint[] = activeBps.filter(b => vscodeBreakpointsLines.indexOf(b.line) === -1);

Expand Down Expand Up @@ -368,7 +365,7 @@ class IotjsDebugSession extends DebugSession {
}))
];

// Get the persists breakpoints.
// Get the persisted breakpoints.
const possibleFBs = this._protocolhandler.getPossibleFunctionBreakpointsByScriptId(scriptId);
persistingFBreakpoints = [
...persistingFBreakpoints,
Expand All @@ -378,7 +375,7 @@ class IotjsDebugSession extends DebugSession {
}).map(b => <TemporaryBreakpoint>{verified: true, line: b.line})
];

// Get the removalbe breakpoints.
// Get the removable breakpoints.
const activeFBs: Breakpoint[] = this._protocolhandler.getActiveFunctionBreakpointsByScriptId(scriptId);
const removeBps: Breakpoint[] = activeFBs.filter(b => {
return vscodeFunctionBreakpointNames.indexOf(b.func.name) === -1;
Expand Down Expand Up @@ -596,6 +593,7 @@ class IotjsDebugSession extends DebugSession {
} else {
write(src);
}
this.sendEvent(new InitializedEvent());
}
}

Expand Down

0 comments on commit 77c23f7

Please sign in to comment.