Skip to content

Inject breakpoint STOPs after InitializedEvent#340

Merged
TwitchBronBron merged 4 commits into
masterfrom
fix/breakpoint-injection-after-initialized-event
May 13, 2026
Merged

Inject breakpoint STOPs after InitializedEvent#340
TwitchBronBron merged 4 commits into
masterfrom
fix/breakpoint-injection-after-initialized-event

Conversation

@chrisdp
Copy link
Copy Markdown
Collaborator

@chrisdp chrisdp commented May 13, 2026

Summary

After #328 deferred InitializedEvent until after prepareMainProject + adapter connect, the telnet path stopped injecting client-side breakpoints. VS Code only starts sending setBreakpoints after it receives InitializedEvent, but by that point the staging files had already been written with STOPs (or not, since no breakpoints were known) and the zip was sealed.

This PR splits the staging from the packaging step for both the main project and component libraries, and runs the packaging step at the start of configurationDoneRequest. By DAP spec, all setBreakpoints requests have arrived by the time configurationDone fires, so STOPs land in the staged .brs files before the zip is sealed.

  • Main project: new packageMainProject helper (breakpoint write + zip), called from configurationDoneRequest before publish.
  • Component libraries: prepareAndHostComponentLibraries split into prepareComponentLibraries (init + stage, parallel with main) and packageAndHostComponentLibraries (write + postfix + zip + install + host, runs in configurationDoneRequest).
  • also, unrelated, prevents the tests from taking a full 60 seconds before finishing.

chrisdp added 2 commits May 13, 2026 11:33
Move the telnet breakpoint STOP injection and the zip-packaging step
out of `prepareMainProject` and into a new `packageMainProject` helper
called from `configurationDoneRequest`, right before `publish`. By the
DAP spec all `setBreakpoints` requests have arrived by the time
`configurationDone` fires, so the breakpoints are known when STOPs are
written into the staged .brs files and before the zip is sealed.
Split `prepareAndHostComponentLibraries` into `prepareComponentLibraries`
(init + stage, runs in launchRequest) and `packageAndHostComponentLibraries`
(write breakpoints + postfix + zip + install + host, runs in
configurationDoneRequest). Mirrors the main project split so component
library breakpoints land before the staged files are written and zipped.
Comment thread src/debugSession/BrightScriptDebugSession.ts Outdated
@TwitchBronBron TwitchBronBron marked this pull request as ready for review May 13, 2026 16:46
@TwitchBronBron TwitchBronBron merged commit 4b3f3e6 into master May 13, 2026
7 checks passed
@TwitchBronBron TwitchBronBron deleted the fix/breakpoint-injection-after-initialized-event branch May 13, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants