|
|
@ -30,9 +30,7 @@ fn thread_picker(
|
|
|
|
dap_callback(
|
|
|
|
dap_callback(
|
|
|
|
cx.jobs,
|
|
|
|
cx.jobs,
|
|
|
|
future,
|
|
|
|
future,
|
|
|
|
move |editor: &mut Editor,
|
|
|
|
move |editor, compositor, response: dap::requests::ThreadsResponse| {
|
|
|
|
compositor: &mut Compositor,
|
|
|
|
|
|
|
|
response: dap::requests::ThreadsResponse| {
|
|
|
|
|
|
|
|
let threads = response.threads;
|
|
|
|
let threads = response.threads;
|
|
|
|
if threads.len() == 1 {
|
|
|
|
if threads.len() == 1 {
|
|
|
|
callback_fn(editor, &threads[0]);
|
|
|
|
callback_fn(editor, &threads[0]);
|
|
|
@ -250,8 +248,7 @@ pub fn dap_launch(cx: &mut Context) {
|
|
|
|
let completions = template.completion.clone();
|
|
|
|
let completions = template.completion.clone();
|
|
|
|
let name = template.name.clone();
|
|
|
|
let name = template.name.clone();
|
|
|
|
let callback = Box::pin(async move {
|
|
|
|
let callback = Box::pin(async move {
|
|
|
|
let call: Callback =
|
|
|
|
let call: Callback = Box::new(move |_editor, compositor| {
|
|
|
|
Box::new(move |_editor: &mut Editor, compositor: &mut Compositor| {
|
|
|
|
|
|
|
|
let prompt = debug_parameter_prompt(completions, name, Vec::new());
|
|
|
|
let prompt = debug_parameter_prompt(completions, name, Vec::new());
|
|
|
|
compositor.push(Box::new(prompt));
|
|
|
|
compositor.push(Box::new(prompt));
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -309,8 +306,7 @@ fn debug_parameter_prompt(
|
|
|
|
let config_name = config_name.clone();
|
|
|
|
let config_name = config_name.clone();
|
|
|
|
let params = params.clone();
|
|
|
|
let params = params.clone();
|
|
|
|
let callback = Box::pin(async move {
|
|
|
|
let callback = Box::pin(async move {
|
|
|
|
let call: Callback =
|
|
|
|
let call: Callback = Box::new(move |_editor, compositor| {
|
|
|
|
Box::new(move |_editor: &mut Editor, compositor: &mut Compositor| {
|
|
|
|
|
|
|
|
let prompt = debug_parameter_prompt(completions, config_name, params);
|
|
|
|
let prompt = debug_parameter_prompt(completions, config_name, params);
|
|
|
|
compositor.push(Box::new(prompt));
|
|
|
|
compositor.push(Box::new(prompt));
|
|
|
|
});
|
|
|
|
});
|
|
|
@ -560,8 +556,7 @@ pub fn dap_edit_condition(cx: &mut Context) {
|
|
|
|
None => return,
|
|
|
|
None => return,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let callback = Box::pin(async move {
|
|
|
|
let callback = Box::pin(async move {
|
|
|
|
let call: Callback =
|
|
|
|
let call: Callback = Box::new(move |_editor, compositor| {
|
|
|
|
Box::new(move |_editor: &mut Editor, compositor: &mut Compositor| {
|
|
|
|
|
|
|
|
let mut prompt = Prompt::new(
|
|
|
|
let mut prompt = Prompt::new(
|
|
|
|
"condition:".into(),
|
|
|
|
"condition:".into(),
|
|
|
|
None,
|
|
|
|
None,
|
|
|
@ -579,8 +574,7 @@ pub fn dap_edit_condition(cx: &mut Context) {
|
|
|
|
|
|
|
|
|
|
|
|
let debugger = debugger!(cx.editor);
|
|
|
|
let debugger = debugger!(cx.editor);
|
|
|
|
|
|
|
|
|
|
|
|
if let Err(e) = breakpoints_changed(debugger, path.clone(), breakpoints)
|
|
|
|
if let Err(e) = breakpoints_changed(debugger, path.clone(), breakpoints) {
|
|
|
|
{
|
|
|
|
|
|
|
|
cx.editor
|
|
|
|
cx.editor
|
|
|
|
.set_error(format!("Failed to set breakpoints: {}", e));
|
|
|
|
.set_error(format!("Failed to set breakpoints: {}", e));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -604,8 +598,7 @@ pub fn dap_edit_log(cx: &mut Context) {
|
|
|
|
None => return,
|
|
|
|
None => return,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
let callback = Box::pin(async move {
|
|
|
|
let callback = Box::pin(async move {
|
|
|
|
let call: Callback =
|
|
|
|
let call: Callback = Box::new(move |_editor, compositor| {
|
|
|
|
Box::new(move |_editor: &mut Editor, compositor: &mut Compositor| {
|
|
|
|
|
|
|
|
let mut prompt = Prompt::new(
|
|
|
|
let mut prompt = Prompt::new(
|
|
|
|
"log-message:".into(),
|
|
|
|
"log-message:".into(),
|
|
|
|
None,
|
|
|
|
None,
|
|
|
@ -622,8 +615,7 @@ pub fn dap_edit_log(cx: &mut Context) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
let debugger = debugger!(cx.editor);
|
|
|
|
let debugger = debugger!(cx.editor);
|
|
|
|
if let Err(e) = breakpoints_changed(debugger, path.clone(), breakpoints)
|
|
|
|
if let Err(e) = breakpoints_changed(debugger, path.clone(), breakpoints) {
|
|
|
|
{
|
|
|
|
|
|
|
|
cx.editor
|
|
|
|
cx.editor
|
|
|
|
.set_error(format!("Failed to set breakpoints: {}", e));
|
|
|
|
.set_error(format!("Failed to set breakpoints: {}", e));
|
|
|
|
}
|
|
|
|
}
|
|
|
|