Skip to content

DAP breakpoints are silently shadowed by a language's native line-breakpoint type (e.g. bundled JavaScript Debugger) — no warning, no setBreakpoints #1705

Closed

Description

@muescha

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), .js demo file

Root cause (confirmed)

  • With the bundled JavaScript Debugger plugin enabled, a gutter breakpoint on the mapped .js file is created under "JavaScript Line Breakpoints". LSP4IJ's DAP handler is never consulted (registerBreakpoint(...) is never called), so no setBreakpoints is sent.

  • ALL-level logging confirms the silence — with these categories enabled there is no BreakpointHandlerBase output 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 .js breakpoints).

Steps to reproduce

  1. IntelliJ Ultimate (bundled JavaScript Debugger enabled).
  2. User-defined DAP config; map *.js to the DAP server.
  3. Set a line breakpoint in a .js file, launch → breakpoint is a "JavaScript Line Breakpoint", never forwarded, execution runs past it.
  4. Disable the JavaScript Debugger plugin, restart, set the breakpoint again → it is a "DAP Breakpoint", setBreakpoints is 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

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

  1. angelozerr commented on Oct 31, 2026

    @angelozerr
    Contributor

    @muescha can we close this issue?

  2. muescha commented on Oct 31, 2026

    @muescha
    ContributorAuthor

    thanks for pointing to this open issue

    it is fixed by #1752

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions