Debugger: support command + file launch config with program fallback and default file behavior#4051
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
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
|
When |
|
@copilot can you add a test making sure the |
Agent-Logs-Url: https://github.com/Shopify/ruby-lsp/sessions/fbded40d-6ad2-44b2-83b8-93393786599f Co-authored-by: rafaelfranca <47848+rafaelfranca@users.noreply.github.com>
Added in 5063240. I updated the debugger launch test to open 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
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.Automated Tests
Updated debugger unit/integration tests to:
command-first shape),filedefaults to${file}when omitted,file: "${file}"is exercised by opening the target file as the active editor before launching debug.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.${file}behavior:{ "type": "ruby_lsp", "request": "launch", "command": "ruby", "file": "${file}" }