debugger: Fix issues with launch.json handling (#32563)
After this PR we can run all the in-tree launch.json examples from [this repo](https://github.com/microsoft/vscode-recipes). Things done: - Fill in default cwd at a lower level for all adapters - Update launch.json parsing for DebugScenario changes - Imitate how VS Code normalizes the `type` field for JS debug tasks - Make version field optional - Extend the variable replacer a bit Release Notes: - Debugger Beta: fixed issues preventing loading and running of debug tasks from VS Code's launch.json. --------- Co-authored-by: Anthony Eid <hello@anthonyeid.me> Co-authored-by: Anthony <anthony@zed.dev> Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
0e0ac9b846
commit
c4277681d1
8 changed files with 111 additions and 44 deletions
|
@ -174,6 +174,13 @@ impl DebugAdapter for RubyDebugAdapter {
|
|||
|
||||
arguments.extend(ruby_config.args);
|
||||
|
||||
let mut configuration = definition.config.clone();
|
||||
if let Some(configuration) = configuration.as_object_mut() {
|
||||
configuration
|
||||
.entry("cwd")
|
||||
.or_insert_with(|| delegate.worktree_root_path().to_string_lossy().into());
|
||||
}
|
||||
|
||||
Ok(DebugAdapterBinary {
|
||||
command: Some(rdbg_path.to_string_lossy().to_string()),
|
||||
arguments,
|
||||
|
@ -190,7 +197,7 @@ impl DebugAdapter for RubyDebugAdapter {
|
|||
envs: ruby_config.env.into_iter().collect(),
|
||||
request_args: StartDebuggingRequestArguments {
|
||||
request: self.request_kind(&definition.config)?,
|
||||
configuration: definition.config.clone(),
|
||||
configuration,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue