Repository navigation
Description
Summary
When a file is DAP-mapped and another enabled debugger plugin already owns a line-breakpoint type for that file's language, the gutter breakpoint is created as the native type (e.g. "JavaScript Line Breakpoint"), not as a "DAP Breakpoint". LSP4IJ's DAP BreakpointHandler is then never invoked, no setBreakpoints is sent, and the breakpoint never binds — with no warning to the user. It looks like "breakpoints don't work", while everything (mapping, path, connection) is actually correct.
This generalises #1389 (PyCharm: "need two breakpoints, native + DAP") to any language that has a bundled/native line-breakpoint type. It cost a full day of debugging to discover; a warning + docs would have made it a 1-minute fix.
Environment
- LSP4IJ: 0.21.0
- IDE: IntelliJ IDEA 2026.3 EAP (Build #IU-263.3889.65), clientID
lsp4ij.debug - OS: macOS 26 (arm64), JBR 25.0.4.1
- DAP server: custom Swift stdio adapter (JavaScriptCore Inspector bridge),
.jsdemo file
Root cause (confirmed)
-
With the bundled JavaScript Debugger plugin enabled, a gutter breakpoint on the mapped
.jsfile is created under "JavaScript Line Breakpoints". LSP4IJ's DAP handler is never consulted (registerBreakpoint(...)is never called), so nosetBreakpointsis sent. -
ALL-level logging confirms the silence — with these categories enabled there is no
BreakpointHandlerBaseoutput at all (not even the "Breakpoint not supported" WARN):com.redhat.devtools.lsp4ij.dap:all com.redhat.devtools.lsp4ij.dap.breakpoints.BreakpointHandlerBase:all -
Disabling the JavaScript Debugger plugin (Settings → Plugins) makes the same gutter breakpoint a "DAP Breakpoint". Now LSP4IJ sends
setBreakpoints, it binds, and the debugger stops correctly. This is the whole fix. -
Cross-check: the identical DAP adapter always worked in VS Code (no competing native JS debugger claims
.jsbreakpoints).
Steps to reproduce
- IntelliJ Ultimate (bundled JavaScript Debugger enabled).
- User-defined DAP config; map
*.jsto the DAP server. - Set a line breakpoint in a
.jsfile, launch → breakpoint is a "JavaScript Line Breakpoint", never forwarded, execution runs past it. - Disable the JavaScript Debugger plugin, restart, set the breakpoint again → it is a "DAP Breakpoint",
setBreakpointsis sent, and it stops.
Why this is a problem
The native breakpoint type silently wins for DAP-mapped files, and nothing tells the user. There is no visible error; the breakpoint dot looks valid; setBreakpoints is simply never emitted. Users conclude "LSP4IJ DAP breakpoints are broken" (cf. #1293, #1389, #1433).
This is not hypothetical. In #1293 the maintainer diagnosed exactly this ("First breakpoint type must be Debug Adapter Protocol and not Python") and closed the report as completed with only a documentation note (#1310) — so today the sole remedy is "use the right breakpoint type / disable the other debugger", not a code fix.
Proposals (feedback welcome — would any of these be accepted?)
1. Docs (cheapest, high value) — a short "Breakpoints & native debuggers" note in the DAP UserGuide + README: "If your file's language already has a debugger (e.g. JavaScript, Python), its native line breakpoint may shadow the DAP breakpoint. Use the 'DAP Breakpoint' type, or disable the competing debugger." (See also the closed docs PR #1310.)
2. Detection + warning — for a DAP-mapped file, LSP4IJ can enumerate the registered XLineBreakpointTypes and check whether a non-DAP type also canPutAt(...) the file. If so, surface a warning:
- at run-config validation (proactive, before launch — best), and/or
- as a one-time balloon at session start: "Breakpoints in
<file>may be handled by<JavaScript Debugger>; DAP breakpoints can be shadowed. [Use DAP breakpoint] [Learn more]".
Also a small inline warning next to a Mappings entry whose language has a competing debugger.
3. Opt-in adoption (generic, driven by the Mappings) — while a DAP session runs, forward the native line breakpoints on mapped files to the adapter, keyed off the existing Mappings (Language / File type / File name pattern) rather than any hardcoded language. The breakpoint keeps its native type, so native debug sessions keep using it normally; the forwarding is session-scoped, so nothing changes outside a DAP session. This is exactly the idea kexul demonstrated for Python in #1389, generalised so it works for any shadowing debugger (JS, Python, Go, …) without per-language code — and users don't have to disable other debuggers. (I have a working implementation of this and am happy to open a PR.)
Happy to test any of these against a real third-party DAP adapter.
Related
- Settting breakpoint in pycharm #1389 (open) — PyCharm: native Python + DAP breakpoints; kexul's proof-of-concept this proposal generalises.
- Breakpoints no longer being sent #1293 (closed, completed) — the same shadowing bug:
setBreakpointsnever sent. The maintainer confirmed the cause ("the wrong breakpoint type was used") and resolved it with only a docs note, i.e. no code fix exists today. - Nothing happens when valid breakpoint added in editor during running DAP debug process #1433 (open) — "Nothing happens when a valid breakpoint is added mid-session"; a third adapter (aer/Apex DAP), same signature: no
setBreakpointsin the trace. - docs: update python docs to clarify setting a breakpoint #1310 (closed PR) — "update python docs to clarify setting a breakpoint"; the documentation that came out of Breakpoints no longer being sent #1293.
Checked but not the same root cause: #1447 ("Cannot set breakpoints") turned out to be a UI-refresh / virtual-file issue (cf. #1455) and was fixed separately.
Activity
angelozerr commentedon Oct 31, 2026
@muescha can we close this issue?
muescha commentedon Oct 31, 2026
thanks for pointing to this open issue
it is fixed by #1752