Repository navigation
Description
Problem 1: breakpoints are not hit
With the attach configuration of the ruby-rdbg template, a breakpoint in hello.rb is never hit:
attach.jsonhas onlytype,nameandrequest.- rdbg answers the
setBreakpointsrequest withverified: falseand the message/path/to/hello.rb could not be located; specify source location in launch.json with "localfsMap" or "localfs". - The program then runs to its end without stopping.
The Ruby page shows the same JSON, so following it leads to the same result.
Cause
rdbg maps local paths only when localfs or localfsMap is set, and it sets this default only for launch, not for attach (server_dap.rb of debug 1.11.1):
- L314,
launch:UI_DAP.local_fs_map_set req.dig('arguments', 'localfs') || req.dig('arguments', 'localfsMap') || true - L321,
attach: the same call without|| true, so the map staysnil. - L361: with no map, every breakpoint gets the message above.
- The attach configuration that rdbg itself writes for VS Code sets
localfs: true(L33-L38).
Problem 2: attaching fails without a port
The template sets the Port field to $port, but attach.json has no port. The Ruby page says to add "port": 12345 by hand. If that step is missed, the run configuration starts anyway and fails only when it connects. The Debug console shows:
Attaching 'Ruby Debug' at :-1
java.lang.IllegalArgumentException: port out of range:-1
Disconnected successfully from the debug server.
- The message shows neither which field is wrong nor how to fix it.
- The settings editor already knows it: next to the
Portfield it shows?instead of a port.
Cause
LaunchUtils.resolveAttachPortreturns-1when$portfinds noportin the DAP parameters.DebugAdapterDescriptor.getServerReadyConfigpasses the-1on, and the socket connect inTransportStreamsrejects it with the exception above.DAPRunConfiguration.checkConfigurationonly checks that a server command or server is set, not the attach port.- The preview next to the field uses the same
resolveAttachPortand shows?for-1(DebugAdapterServerPanel).
No check for a missing port
This part is not specific to Ruby: any DAP run configuration in Attach mode whose port can't be resolved starts and fails the same way.
Proposal
-
Add
"localfs": truetoattach.json, and show it in the JSON of the Ruby page:{ "type": "rdbg", "name": "Attach with rdbg", "request": "attach", "localfs": true }localfs: trueassumes that rdbg runs on the same file system as the IDE. That is the case for therdbg --open --port 12345 hello.rbsetup that the page describes. A remote setup would needlocalfsMapinstead. -
For the port, one of:
- add
"port": 12345toattach.json, matching the command on the Ruby page, or - keep it out of the template, but let
checkConfigurationreport an attach port that can't be resolved, for exampleAttach port is missing: add "port" to the DAP parameters or enter a port. IntelliJ then shows the error in the run configuration dialog and before the start, instead of the exception.
- add
The check in checkConfiguration would help every template, the default port only Ruby.
How this was checked
- Ruby 4.0.9 (installed with mise), debug 1.11.1, LSP4IJ 0.30.2-SNAPSHOT.
- IntelliJ IDEA 2026.3.1 Preview, and IntelliJ IDEA 2024.2 started with
./gradlew runIde, on macOS. rdbg --open --port 12345 hello.rb, breakpoint onputs user.- Without
localfs: the breakpoint is reported as not located and the program runs through. - With
"localfs": true: the session stops onputs user. - Without
portin the DAP parameters: the console showsport out of range:-1, as above.
Pair-programmed with ❤️ by @muescha and ⚙️ by 🤖 Claude Code
Activity
fix: the Ruby rdbg template's attach configuration sets localfs, so t…
lagergren commentedon Nov 26, 2026
Problem 1 is fixed by #2294: the template's
attach.jsonsets"localfs": true, and the Ruby page shows and explains it. Problem 2, a clear error for a missing attach port inDAPRunConfiguration.checkConfigurationthat would help every template, stays open here for 0.30.3.fix: the Ruby rdbg template's attach configuration sets localfs, so t…