Skip to content

Commit

Permalink
Report breakpoint ID and fix extension launch config
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonpaulos committed Nov 15, 2023
1 parent e003cfb commit f2d96af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"--extensionDevelopmentPath=${workspaceFolder}/extension",
"${workspaceFolder}/sampleWorkspace"
],
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"outFiles": ["${workspaceFolder}/extension/dist/**/*.js"],
"preLaunchTask": "npm: watch"
},
{
Expand Down
9 changes: 7 additions & 2 deletions src/debugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,13 @@ export class AvmDebugSession extends DebugSession {
this._runtime.on(RuntimeEvents.stopOnStep, () => {
this.sendEvent(new StoppedEvent('step', AvmDebugSession.threadID));
});
this._runtime.on(RuntimeEvents.stopOnBreakpoint, () => {
this.sendEvent(new StoppedEvent('breakpoint', AvmDebugSession.threadID));
this._runtime.on(RuntimeEvents.stopOnBreakpoint, (breakpointID: number) => {
const event = new StoppedEvent(
'breakpoint',
AvmDebugSession.threadID,
) as DebugProtocol.StoppedEvent;
event.body.hitBreakpointIds = [breakpointID];
this.sendEvent(event);
});
this._runtime.on(RuntimeEvents.stopOnException, (message) => {
this.sendEvent(
Expand Down
2 changes: 1 addition & 1 deletion src/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export class AvmRuntime extends EventEmitter {
);
if (bps.length !== 0) {
// send 'stopped' event
this.sendEvent(RuntimeEvents.stopOnBreakpoint);
this.sendEvent(RuntimeEvents.stopOnBreakpoint, bps[0].id);

// the following shows the use of 'breakpoint' events to update properties of a breakpoint in the UI
// if breakpoint is not yet verified, verify it now and send a 'breakpoint' update event
Expand Down

0 comments on commit f2d96af

Please sign in to comment.