debugger: Add debug task picker to new session modal (#29702)
## Preview  ### TODO - [x] Add scenario picker to new session modal - [x] Make debugger start action open new session modal instead of task modal - [x] Fix `esc` not clearing the cancelling the new session modal while it's in scenario or attach mode - [x] Resolve debug scenario's correctly Release Notes: - N/A
This commit is contained in:
parent
ba59305510
commit
f619d5f02a
9 changed files with 607 additions and 180 deletions
|
@ -5,9 +5,7 @@ use editor::Editor;
|
|||
use gpui::{App, AppContext as _, Context, Entity, Task, Window};
|
||||
use modal::TaskOverrides;
|
||||
use project::{Location, TaskContexts, TaskSourceKind, Worktree};
|
||||
use task::{
|
||||
RevealTarget, TaskContext, TaskId, TaskModal, TaskTemplate, TaskVariables, VariableName,
|
||||
};
|
||||
use task::{RevealTarget, TaskContext, TaskId, TaskTemplate, TaskVariables, VariableName};
|
||||
use workspace::Workspace;
|
||||
|
||||
mod modal;
|
||||
|
@ -83,7 +81,7 @@ pub fn init(cx: &mut App) {
|
|||
);
|
||||
}
|
||||
} else {
|
||||
toggle_modal(workspace, None, TaskModal::ScriptModal, window, cx).detach();
|
||||
toggle_modal(workspace, None, window, cx).detach();
|
||||
};
|
||||
});
|
||||
},
|
||||
|
@ -125,21 +123,15 @@ fn spawn_task_or_modal(
|
|||
)
|
||||
.detach_and_log_err(cx)
|
||||
}
|
||||
Spawn::ViaModal { reveal_target } => toggle_modal(
|
||||
workspace,
|
||||
*reveal_target,
|
||||
TaskModal::ScriptModal,
|
||||
window,
|
||||
cx,
|
||||
)
|
||||
.detach(),
|
||||
Spawn::ViaModal { reveal_target } => {
|
||||
toggle_modal(workspace, *reveal_target, window, cx).detach()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub fn toggle_modal(
|
||||
workspace: &mut Workspace,
|
||||
reveal_target: Option<RevealTarget>,
|
||||
task_type: TaskModal,
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Workspace>,
|
||||
) -> Task<()> {
|
||||
|
@ -162,7 +154,6 @@ pub fn toggle_modal(
|
|||
reveal_target: Some(target),
|
||||
}),
|
||||
workspace_handle,
|
||||
task_type,
|
||||
window,
|
||||
cx,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue