Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/ruby.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,17 @@ impl zed::Extension for RubyExtension {
if let Some(script) = &ruby_config.script {
arguments.push(script.clone());
} else if let Some(command) = &ruby_config.command {
arguments.push("--command".to_string());
arguments.push(command.clone());
arguments.extend(["--command".into(), "--".into(), command.clone()]);
} else if let Some(command_or_script) = &ruby_config.script_or_command {
if worktree.which(command_or_script).is_some() {
Copy link
Copy Markdown
Collaborator

@vitallium vitallium Jun 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought (non-blocking): I wonder why we need to check if command_or_script exists in a worktree here. We should check that later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can tell, the requirement for command_or_script comes from the dap_config_to_scenario method. We aren't sure if what they're giving us is a script or a command, but we don't have access to the worktree in that method, so we forward it along and let the get_dap_binary deal with checking that. Agreed that we should investigate how necessary command_or_script is though.

arguments.push("--command".to_string());
arguments.extend([
"--command".into(),
"--".into(),
command_or_script.clone(),
]);
} else {
arguments.push(command_or_script.clone());
}
arguments.push(command_or_script.clone());
} else {
return Err("Ruby debug config must have 'script' or 'command' args".into());
}
Expand All @@ -218,6 +222,10 @@ impl zed::Extension for RubyExtension {
}
}

if !arguments.contains(&"--command".to_string()) {
// Ensure that all arguments are passed after a "--", as required by rdbg.
arguments.push("--".into());
}
arguments.extend(ruby_config.args);

if use_bundler {
Expand Down