| 1364 | } |
| 1365 | |
| 1366 | private async _onThreadPaused(details: IPausedDetails) { |
| 1367 | this._expectedPauseReason = undefined; |
| 1368 | this._onPausedEmitter.fire(details); |
| 1369 | |
| 1370 | // If we hit breakpoints, try to make sure they all get resolved before we |
| 1371 | // send the event to the UI. This should generally only happen if the UI |
| 1372 | // bulk-set breakpoints and some resolve faster than others, since we expect |
| 1373 | // the CDP in turn will tell *us* they're resolved before hitting them. |
| 1374 | if (details.hitBreakpoints) { |
| 1375 | await Promise.race([ |
| 1376 | delay(1000), |
| 1377 | Promise.all( |
| 1378 | details.hitBreakpoints |
| 1379 | .map(bp => this._breakpointManager._resolvedBreakpoints.get(bp)) |
| 1380 | .filter((bp): bp is UserDefinedBreakpoint => bp instanceof UserDefinedBreakpoint) |
| 1381 | .map(r => r.untilSetCompleted()), |
| 1382 | ), |
| 1383 | ]); |
| 1384 | } |
| 1385 | |
| 1386 | this._dap.with(dap => |
| 1387 | dap.stopped({ |
| 1388 | reason: details.reason, |
| 1389 | description: details.description, |
| 1390 | threadId: this.id, |
| 1391 | text: details.text, |
| 1392 | allThreadsStopped: false, |
| 1393 | }), |
| 1394 | ); |
| 1395 | } |
| 1396 | |
| 1397 | private _onThreadResumed() { |
| 1398 | this._dap.with(dap => |