Skip to content

Commit 77c23f7

Browse files
tdusnokirobertsipka
authored andcommitted
(WIP) Call InitializedEvent after source is sent to get persisted breakpoints (#31)
IoT.js-VSCode-DCO-1.0-Signed-off-by: Tibor Dusnoki [email protected]
1 parent 8b1f6e6 commit 77c23f7

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/IotjsDebugger.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,6 @@ class IotjsDebugSession extends DebugSession {
219219
.catch(error => {
220220
this.log(error.message, LOG_LEVEL.ERROR);
221221
this.sendErrorResponse(response, error);
222-
})
223-
.then(() => {
224-
this.sendEvent(new InitializedEvent());
225222
});
226223
}
227224

@@ -312,13 +309,13 @@ class IotjsDebugSession extends DebugSession {
312309
}
313310
}));
314311

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

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

@@ -368,7 +365,7 @@ class IotjsDebugSession extends DebugSession {
368365
}))
369366
];
370367

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

381-
// Get the removalbe breakpoints.
378+
// Get the removable breakpoints.
382379
const activeFBs: Breakpoint[] = this._protocolhandler.getActiveFunctionBreakpointsByScriptId(scriptId);
383380
const removeBps: Breakpoint[] = activeFBs.filter(b => {
384381
return vscodeFunctionBreakpointNames.indexOf(b.func.name) === -1;
@@ -596,6 +593,7 @@ class IotjsDebugSession extends DebugSession {
596593
} else {
597594
write(src);
598595
}
596+
this.sendEvent(new InitializedEvent());
599597
}
600598
}
601599

0 commit comments

Comments
 (0)