|
|
@ -5,7 +5,10 @@ use crate::{
|
|
|
|
job::Callback,
|
|
|
|
job::Callback,
|
|
|
|
ui::{FilePicker, Prompt, PromptEvent},
|
|
|
|
ui::{FilePicker, Prompt, PromptEvent},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
use helix_core::{syntax::DebugConfigCompletion, Selection};
|
|
|
|
use helix_core::{
|
|
|
|
|
|
|
|
syntax::{DebugArgumentValue, DebugConfigCompletion},
|
|
|
|
|
|
|
|
Selection,
|
|
|
|
|
|
|
|
};
|
|
|
|
use helix_dap::{self as dap, Client, ThreadId};
|
|
|
|
use helix_dap::{self as dap, Client, ThreadId};
|
|
|
|
use helix_lsp::block_on;
|
|
|
|
use helix_lsp::block_on;
|
|
|
|
|
|
|
|
|
|
|
@ -239,13 +242,26 @@ pub fn dap_start_impl(
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// For param #0 replace {0} in args
|
|
|
|
// For param #0 replace {0} in args
|
|
|
|
value = value.replace(format!("{{{}}}", i).as_str(), ¶m);
|
|
|
|
value = match value {
|
|
|
|
|
|
|
|
DebugArgumentValue::String(v) => {
|
|
|
|
|
|
|
|
DebugArgumentValue::String(v.replace(format!("{{{}}}", i).as_str(), ¶m))
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
DebugArgumentValue::Array(arr) => DebugArgumentValue::Array(
|
|
|
|
|
|
|
|
arr.iter()
|
|
|
|
|
|
|
|
.map(|v| v.replace(format!("{{{}}}", i).as_str(), ¶m))
|
|
|
|
|
|
|
|
.collect(),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if let Ok(integer) = value.parse::<usize>() {
|
|
|
|
if let DebugArgumentValue::String(string) = value {
|
|
|
|
args.insert(k, Value::Number(serde_json::Number::from(integer)));
|
|
|
|
if let Ok(integer) = string.parse::<usize>() {
|
|
|
|
} else {
|
|
|
|
args.insert(k, to_value(integer).unwrap());
|
|
|
|
args.insert(k, Value::String(value));
|
|
|
|
} else {
|
|
|
|
|
|
|
|
args.insert(k, to_value(string).unwrap());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if let DebugArgumentValue::Array(arr) = value {
|
|
|
|
|
|
|
|
args.insert(k, to_value(arr).unwrap());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|