Debugger: support command + file launch config with program fallback and default file behavior#4051
Open
Debugger: support command + file launch config with program fallback and default file behavior#4051
command + file launch config with program fallback and default file behavior#4051Conversation
Copilot
AI
changed the title
[WIP] Fix debugger fails when file path contains spaces
Debugger: support Apr 8, 2026
command + file launch config with program fallback and default file behavior
6b91f2e to
f8af8f7
Compare
f8af8f7 to
273d920
Compare
Agent-Logs-Url: https://github.com/Shopify/ruby-lsp/sessions/c58776f4-6c4e-431c-9029-cac8f3db34a5 Co-authored-by: rafaelfranca <47848+rafaelfranca@users.noreply.github.com>
273d920 to
2bd8754
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Debugger launch fails when workspace/file paths contain spaces because the previous default config built a single unquoted
programstring (for example,ruby ${file}), which gets split by the shell.This change addresses that path-tokenization failure while preserving compatibility with existing
program-based launch configs.Implementation
Config shape update (Option B)
command+filelaunch configuration support.programas a backward-compatible fallback.Defaulting behavior
filenow defaults to${file}during config resolution when:commandis presentprogramis absentfileis omitted${relativeFile}where needed.Generated debugger templates/docs
Debug scriptnow emits only:{ "type": "ruby_lsp", "name": "Debug script", "request": "launch", "command": "ruby" }Debug testemits explicit relative file:{ "type": "ruby_lsp", "name": "Debug test", "request": "launch", "command": "ruby -Itest", "file": "${relativeFile}" }Launch command construction hardening
command+file, the extension constructsprogramwith quoting/escaping for the file argument.command/filebefore shell execution.Automated Tests
Updated debugger unit/integration tests to:
command-first shape),filedefaults to${file}when omitted,Manual Tests
launch.jsonvia “Debug: Add configuration...”.fileand still launches current file.${relativeFile}flow still launches correctly.{ "type": "ruby_lsp", "request": "launch", "program": "ruby ${file}" }programpath.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
update.code.visualstudio.com/opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node ./out/test/runTest.js --grep Debugger(dns block)/home/REDACTED/work/_temp/ghcca-node/node/bin/node node ./out/test/runTest.js --grep Debugger(dns block)If you need me to access, download, or install something from one of these locations, you can either: