debugger: More tidy up for SSH (#28993)
Split `locator` out of DebugTaskDefinition to make it clearer when location needs to happen. Release Notes: - N/A --------- Co-authored-by: Anthony Eid <hello@anthonyeid.me> Co-authored-by: Anthony <anthony@zed.dev> Co-authored-by: Cole Miller <m@cole-miller.net>
This commit is contained in:
parent
d13cd007a2
commit
9d35f0389d
57 changed files with 1146 additions and 884 deletions
|
@ -5111,44 +5111,21 @@ impl Editor {
|
|||
CodeActionsItem::Task(task_source_kind, resolved_task) => {
|
||||
match resolved_task.task_type() {
|
||||
task::TaskType::Script => workspace.update(cx, |workspace, cx| {
|
||||
workspace::tasks::schedule_resolved_task(
|
||||
workspace,
|
||||
workspace.schedule_resolved_task(
|
||||
task_source_kind,
|
||||
resolved_task,
|
||||
false,
|
||||
window,
|
||||
cx,
|
||||
);
|
||||
|
||||
Some(Task::ready(Ok(())))
|
||||
}),
|
||||
task::TaskType::Debug(debug_args) => {
|
||||
if debug_args.locator.is_some() {
|
||||
workspace.update(cx, |workspace, cx| {
|
||||
workspace::tasks::schedule_resolved_task(
|
||||
workspace,
|
||||
task_source_kind,
|
||||
resolved_task,
|
||||
false,
|
||||
cx,
|
||||
);
|
||||
});
|
||||
|
||||
return Some(Task::ready(Ok(())));
|
||||
}
|
||||
|
||||
if let Some(project) = self.project.as_ref() {
|
||||
project
|
||||
.update(cx, |project, cx| {
|
||||
project.start_debug_session(
|
||||
resolved_task.resolved_debug_adapter_config().unwrap(),
|
||||
cx,
|
||||
)
|
||||
})
|
||||
.detach_and_log_err(cx);
|
||||
Some(Task::ready(Ok(())))
|
||||
} else {
|
||||
Some(Task::ready(Ok(())))
|
||||
}
|
||||
task::TaskType::Debug(_) => {
|
||||
workspace.update(cx, |workspace, cx| {
|
||||
workspace.schedule_debug_task(resolved_task, window, cx);
|
||||
});
|
||||
Some(Task::ready(Ok(())))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -6845,12 +6822,12 @@ impl Editor {
|
|||
resolved.reveal = reveal_strategy;
|
||||
|
||||
workspace
|
||||
.update(cx, |workspace, cx| {
|
||||
workspace::tasks::schedule_resolved_task(
|
||||
workspace,
|
||||
.update_in(cx, |workspace, window, cx| {
|
||||
workspace.schedule_resolved_task(
|
||||
task_source_kind,
|
||||
resolved_task,
|
||||
false,
|
||||
window,
|
||||
cx,
|
||||
);
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue