ruby: Add basic documentation about debugging (#33572)

Hi, this pull request adds basic documentation about debugging feature
available in the Ruby extension.


Release Notes:

- N/A
This commit is contained in:
Vitaly Slobodin 2025-07-01 15:12:08 +02:00 committed by GitHub
parent 6e9c6c5684
commit 0fe73a99e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -340,3 +340,41 @@ Plain minitest does not support running tests by line number, only by name, so w
```
Similar task syntax can be used for other test frameworks such as `quickdraw` or `tldr`.
## Debugging
The Ruby extension provides a debug adapter for debugging Ruby code. Zed's name for the adapter (in the UI and `debug.json`) is `rdbg`, and under the hood, it uses the [`debug`](https://github.com/ruby/debug) gem. The extension uses the [same activation logic](#language-server-activation) as the language servers.
### Examples
#### Debug a Ruby script
```jsonc
[
{
"label": "Debug current file",
"adapter": "rdbg",
"request": "launch",
"script": "$ZED_FILE",
"cwd": "$ZED_WORKTREE_ROOT",
},
]
```
#### Debug Rails server
```jsonc
[
{
"label": "Debug Rails server",
"adapter": "rdbg",
"request": "launch",
"command": "$ZED_WORKTREE_ROOT/bin/rails",
"args": ["server"],
"cwd": "$ZED_WORKTREE_ROOT",
"env": {
"RUBY_DEBUG_OPEN": "true",
},
},
]
```