Add empty response stub for Debugger.getPossibleBreakpoints#2066
Open
huntie wants to merge 1 commit into
Open
Conversation
Summary: NOTE: This is the minimum fix for fixing React Native compatibility with [vscode-js-debug](https://github.com/microsoft/vscode-js-debug). D109301771 continues by implementing this method fully. **Motivation**: CDP spec / VS Code debugger compatibility. `Debugger.getPossibleBreakpoints` is a gap in our Chrome DevTools Protocol coverage. To date, this hasn't been load bearing for our Chrome DevTools frontend fork in React Native DevTools. **However**, in other clients such as VS Code, not implementing this method breaks debugging against Hermes targets, since these clients expect at minimum a spec compliant CDP response (currently `-32601 method not found`). **This diff** Handle `Debugger.getPossibleBreakpoints` in Hermes as a spec-compliant stub endpoint, unconditionally returning an empty result (`{ locations: [] }`). - A stub is how Expo and Radon IDE handle this issue today, e.g. `VscodeDebuggerGetPossibleBreakpointsHandler` in Expo CLI. https://github.com/expo/expo/blob/cc3f274fa0bb56aa0aa85ef68d78f1348e40d7f8/packages/%40expo/cli/src/start/server/metro/debugging/messageHandlers/VscodeDebuggerGetPossibleBreakpoints.ts#L17-L22 **This change alone is enough to stop VS Code erroring.** Computing breakpoint locations is a bit more involved (and notably might be blocked by the newer Babel transform profile rollout in RN), and is implemented separately in the next diff. **Changes** - Add `Debugger.getPossibleBreakpoints` to the CDP message-type roots (`cdp/tools/message_types.txt`) and regenerate `MessageTypes.{h,cpp}` (the pinned upstream protocol already defines the request/response and `BreakLocation` types). - Dispatch the method in `CDPAgent` to a new `DebuggerDomainAgent::getPossibleBreakpoints` that unconditionally returns `{ locations: [] }`. Differential Revision: D109439195
|
@huntie has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109439195. |
huntie
added a commit
to huntie/hermes
that referenced
this pull request
Jun 23, 2026
…#2066) Summary: NOTE: This is the minimum fix for fixing React Native compatibility with [vscode-js-debug](https://github.com/microsoft/vscode-js-debug). D109301771 continues by implementing this method fully. **Motivation**: CDP spec / VS Code debugger compatibility. `Debugger.getPossibleBreakpoints` is a gap in our Chrome DevTools Protocol coverage. To date, this hasn't been load bearing for our Chrome DevTools frontend fork in React Native DevTools. **However**, in other clients such as VS Code, not implementing this method breaks debugging against Hermes targets, since these clients expect at minimum a spec compliant CDP response (currently `-32601 method not found`). **This diff** Handle `Debugger.getPossibleBreakpoints` in Hermes as a spec-compliant stub endpoint, unconditionally returning an empty result (`{ locations: [] }`). - This is valid / equivalent to today's behaviour — setting a breakpoint applies to the whole line (no inner granularity). - A stub is how Expo and Radon IDE handle this issue today, e.g. `VscodeDebuggerGetPossibleBreakpointsHandler` in Expo CLI. https://github.com/expo/expo/blob/cc3f274fa0bb56aa0aa85ef68d78f1348e40d7f8/packages/%40expo/cli/src/start/server/metro/debugging/messageHandlers/VscodeDebuggerGetPossibleBreakpoints.ts#L17-L22 **This change alone is enough to stop VS Code erroring.** Computing breakpoint locations is a bit more involved (and notably might be blocked by the newer Babel transform profile rollout in RN), and is implemented separately in the next diff. **Changes** - Add `Debugger.getPossibleBreakpoints` to the CDP message-type roots (`cdp/tools/message_types.txt`) and regenerate `MessageTypes.{h,cpp}` (the pinned upstream protocol already defines the request/response and `BreakLocation` types). - Dispatch the method in `CDPAgent` to a new `DebuggerDomainAgent::getPossibleBreakpoints` that unconditionally returns `{ locations: [] }`. Differential Revision: D109439195
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
NOTE: This is the minimum fix for fixing React Native compatibility with vscode-js-debug. D109301771 continues by implementing this method fully.
Motivation: CDP spec / VS Code debugger compatibility.
Debugger.getPossibleBreakpointsis a gap in our Chrome DevTools Protocol coverage. To date, this hasn't been load bearing for our Chrome DevTools frontend fork in React Native DevTools. However, in other clients such as VS Code, not implementing this method breaks debugging against Hermes targets, since these clients expect at minimum a spec compliant CDP response (currently-32601 method not found).This diff
Handle
Debugger.getPossibleBreakpointsin Hermes as a spec-compliant stub endpoint, unconditionally returning an empty result ({ locations: [] }).VscodeDebuggerGetPossibleBreakpointsHandlerin Expo CLI.https://github.com/expo/expo/blob/cc3f274fa0bb56aa0aa85ef68d78f1348e40d7f8/packages/%40expo/cli/src/start/server/metro/debugging/messageHandlers/VscodeDebuggerGetPossibleBreakpoints.ts#L17-L22
This change alone is enough to stop VS Code erroring. Computing breakpoint locations is a bit more involved (and notably might be blocked by the newer Babel transform profile rollout in RN), and is implemented separately in the next diff.
Changes
Debugger.getPossibleBreakpointsto the CDP message-type roots (cdp/tools/message_types.txt) and regenerateMessageTypes.{h,cpp}(the pinned upstream protocol already defines the request/response andBreakLocationtypes).CDPAgentto a newDebuggerDomainAgent::getPossibleBreakpointsthat unconditionally returns{ locations: [] }.Differential Revision: D109439195