File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -202,13 +202,17 @@ impl zed::Extension for RubyExtension {
202
202
if let Some ( script) = & ruby_config. script {
203
203
arguments. push ( script. clone ( ) ) ;
204
204
} else if let Some ( command) = & ruby_config. command {
205
- arguments. push ( "--command" . to_string ( ) ) ;
206
- arguments. push ( command. clone ( ) ) ;
205
+ arguments. extend ( [ "--command" . into ( ) , "--" . into ( ) , command. clone ( ) ] ) ;
207
206
} else if let Some ( command_or_script) = & ruby_config. script_or_command {
208
207
if worktree. which ( command_or_script) . is_some ( ) {
209
- arguments. push ( "--command" . to_string ( ) ) ;
208
+ arguments. extend ( [
209
+ "--command" . into ( ) ,
210
+ "--" . into ( ) ,
211
+ command_or_script. clone ( ) ,
212
+ ] ) ;
213
+ } else {
214
+ arguments. push ( command_or_script. clone ( ) ) ;
210
215
}
211
- arguments. push ( command_or_script. clone ( ) ) ;
212
216
} else {
213
217
return Err ( "Ruby debug config must have 'script' or 'command' args" . into ( ) ) ;
214
218
}
@@ -218,6 +222,10 @@ impl zed::Extension for RubyExtension {
218
222
}
219
223
}
220
224
225
+ if !arguments. contains ( & "--command" . to_string ( ) ) {
226
+ // Ensure that all arguments are passed after a "--", as required by rdbg.
227
+ arguments. push ( "--" . into ( ) ) ;
228
+ }
221
229
arguments. extend ( ruby_config. args ) ;
222
230
223
231
if use_bundler {
You can’t perform that action at this time.
0 commit comments