Skip to content

Defer DAP capabilities and InitializedEvent until after adapter connects#328

Draft
chrisdp wants to merge 2 commits intomasterfrom
feature/defer-dap-capabilities-until-adapter-connected
Draft

Defer DAP capabilities and InitializedEvent until after adapter connects#328
chrisdp wants to merge 2 commits intomasterfrom
feature/defer-dap-capabilities-until-adapter-connected

Conversation

@chrisdp
Copy link
Copy Markdown
Collaborator

@chrisdp chrisdp commented Apr 8, 2026

Summary

  • Move InitializedEvent from initializeRequest to launchRequest, sent after the Roku adapter connects — so VS Code's configuration phase (setBreakpoints, setExceptionBreakpoints, configurationDone) happens with a live connection
  • Move post-configuration work (sg commands, home button, publish, activate, deep link) into configurationDoneRequest so it runs only after VS Code has finished sending breakpoint config
  • Send a CapabilitiesEvent just before InitializedEvent to advertise adapter-specific capabilities:
    • supportsLogPoints only for telnet (not debug protocol)
    • Exception breakpoint support (supportsExceptionFilterOptions, supportsExceptionOptions, exceptionBreakpointFilters) conditional on rokuAdapter.supportsExceptionBreakpoints
  • Remove supportsStepBack = false (redundant default) and stale comments

Test plan

  • Launch a debug session using the telnet adapter — verify log points UI appears and exception breakpoint filters show in the Breakpoints panel
  • Launch a debug session using the debug protocol adapter — verify log points UI does NOT appear and exception breakpoints are hidden if not supported
  • Verify breakpoints set before launch are correctly registered (sent during configuration phase)
  • Verify configurationDone triggers the publish/activate flow as expected

🤖 Generated with Claude Code

- Move InitializedEvent from initializeRequest to launchRequest, sent
  after the roku adapter connects so VS Code's configuration phase
  (setBreakpoints, setExceptionBreakpoints, configurationDone) happens
  with a live connection
- Move post-configuration work (sg commands, publish, activate, deep
  link) into configurationDoneRequest so it runs after VS Code has
  finished sending breakpoint config
- Send a CapabilitiesEvent just before InitializedEvent to advertise
  adapter-specific capabilities: supportsLogPoints only for telnet, and
  exception breakpoint support conditional on rokuAdapter.supportsExceptionBreakpoints
- Remove supportsStepBack = false (default) and stale comments

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@chrisdp chrisdp marked this pull request as draft April 8, 2026 23:39
… events

- Move sendResponse(response) to after the adapter connects and
  CapabilitiesEvent is sent, so VS Code's onDidStartDebugSession fires
  with a fully connected adapter
- Add launch progress events: 'Finding device on network', 'Packaging
  Project(s)', 'Connecting to debug server', 'Configuring breakpoints'
- Wrap all launchRequest setup in a single try/catch

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant