Skip to content

Add empty response stub for Debugger.getPossibleBreakpoints#2066

Open
huntie wants to merge 1 commit into
facebook:static_hfrom
huntie:export-D109439195
Open

Add empty response stub for Debugger.getPossibleBreakpoints#2066
huntie wants to merge 1 commit into
facebook:static_hfrom
huntie:export-D109439195

Conversation

@huntie

@huntie huntie commented Jun 23, 2026

Copy link
Copy Markdown
Member

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.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

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
@meta-codesync

meta-codesync Bot commented Jun 23, 2026

Copy link
Copy Markdown

@huntie has exported this pull request. If you are a Meta employee, you can view the originating Diff in D109439195.

@meta-cla meta-cla Bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jun 23, 2026
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant