@@ -5,7 +5,10 @@ use crate::{
55 job::Callback,
66 ui::{FilePicker, Prompt, PromptEvent},
77};
8−use helix_core::{syntax::DebugConfigCompletion, Selection};
8+use helix_core::{
9+ syntax::{DebugArgumentValue, DebugConfigCompletion},
10+ Selection,
11+};
912use helix_dap::{self as dap, Client, ThreadId};
1013use helix_lsp::block_on;
1114
@@ -239,13 +242,26 @@ pub fn dap_start_impl(
239242 }
240243 }
241244 // For param #0 replace {0} in args
242− value = value.replace(format!("{{{}}}", i).as_str(), ¶m);
245+ value = match value {
246+ DebugArgumentValue::String(v) => {
247+ DebugArgumentValue::String(v.replace(format!("{{{}}}", i).as_str(), ¶m))
248+ }
249+ DebugArgumentValue::Array(arr) => DebugArgumentValue::Array(
250+ arr.iter()
251+ .map(|v| v.replace(format!("{{{}}}", i).as_str(), ¶m))
252+ .collect(),
253+ ),
254+ };
243255 }
244256
245− if let Ok(integer) = value.parse::<usize>() {
246− args.insert(k, Value::Number(serde_json::Number::from(integer)));
247− } else {
248− args.insert(k, Value::String(value));
257+ if let DebugArgumentValue::String(string) = value {
258+ if let Ok(integer) = string.parse::<usize>() {
259+ args.insert(k, to_value(integer).unwrap());
260+ } else {
261+ args.insert(k, to_value(string).unwrap());
262+ }
263+ } else if let DebugArgumentValue::Array(arr) = value {
264+ args.insert(k, to_value(arr).unwrap());
249265 }
250266 }
251267 }