Unify the tasks modal and the new session modal (#31646)
Release Notes: - Debugger Beta: added a button to the quick action bar to start a debug session or spawn a task, depending on which of these actions was taken most recently. - Debugger Beta: incorporated the tasks modal into the new session modal as an additional tab. --------- Co-authored-by: Julia Ryan <juliaryan3.14@gmail.com> Co-authored-by: Julia Ryan <p1n3appl3@users.noreply.github.com> Co-authored-by: Anthony Eid <hello@anthonyeid.me> Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
parent
804de3316e
commit
1445af559b
12 changed files with 434 additions and 224 deletions
|
@ -56,6 +56,10 @@ impl Workspace {
|
|||
) {
|
||||
let spawn_in_terminal = resolved_task.resolved.clone();
|
||||
if !omit_history {
|
||||
if let Some(debugger_provider) = self.debugger_provider.as_ref() {
|
||||
debugger_provider.task_scheduled(cx);
|
||||
}
|
||||
|
||||
self.project().update(cx, |project, cx| {
|
||||
if let Some(task_inventory) =
|
||||
project.task_store().read(cx).task_inventory().cloned()
|
||||
|
|
|
@ -100,13 +100,13 @@ use task::{DebugScenario, SpawnInTerminal, TaskContext};
|
|||
use theme::{ActiveTheme, SystemAppearance, ThemeSettings};
|
||||
pub use toolbar::{Toolbar, ToolbarItemEvent, ToolbarItemLocation, ToolbarItemView};
|
||||
pub use ui;
|
||||
use ui::prelude::*;
|
||||
use ui::{Window, prelude::*};
|
||||
use util::{ResultExt, TryFutureExt, paths::SanitizedPath, serde::default_true};
|
||||
use uuid::Uuid;
|
||||
pub use workspace_settings::{
|
||||
AutosaveSetting, BottomDockLayout, RestoreOnStartupBehavior, TabBarSettings, WorkspaceSettings,
|
||||
};
|
||||
use zed_actions::feedback::FileBugReport;
|
||||
use zed_actions::{Spawn, feedback::FileBugReport};
|
||||
|
||||
use crate::notifications::NotificationId;
|
||||
use crate::persistence::{
|
||||
|
@ -149,6 +149,18 @@ pub trait DebuggerProvider {
|
|||
window: &mut Window,
|
||||
cx: &mut App,
|
||||
);
|
||||
|
||||
fn spawn_task_or_modal(
|
||||
&self,
|
||||
workspace: &mut Workspace,
|
||||
action: &Spawn,
|
||||
window: &mut Window,
|
||||
cx: &mut Context<Workspace>,
|
||||
);
|
||||
|
||||
fn task_scheduled(&self, cx: &mut App);
|
||||
fn debug_scenario_scheduled(&self, cx: &mut App);
|
||||
fn debug_scenario_scheduled_last(&self, cx: &App) -> bool;
|
||||
}
|
||||
|
||||
actions!(
|
||||
|
@ -947,7 +959,7 @@ pub struct Workspace {
|
|||
on_prompt_for_new_path: Option<PromptForNewPath>,
|
||||
on_prompt_for_open_path: Option<PromptForOpenPath>,
|
||||
terminal_provider: Option<Box<dyn TerminalProvider>>,
|
||||
debugger_provider: Option<Box<dyn DebuggerProvider>>,
|
||||
debugger_provider: Option<Arc<dyn DebuggerProvider>>,
|
||||
serializable_items_tx: UnboundedSender<Box<dyn SerializableItemHandle>>,
|
||||
serialized_ssh_project: Option<SerializedSshProject>,
|
||||
_items_serializer: Task<Result<()>>,
|
||||
|
@ -1828,7 +1840,11 @@ impl Workspace {
|
|||
}
|
||||
|
||||
pub fn set_debugger_provider(&mut self, provider: impl DebuggerProvider + 'static) {
|
||||
self.debugger_provider = Some(Box::new(provider));
|
||||
self.debugger_provider = Some(Arc::new(provider));
|
||||
}
|
||||
|
||||
pub fn debugger_provider(&self) -> Option<Arc<dyn DebuggerProvider>> {
|
||||
self.debugger_provider.clone()
|
||||
}
|
||||
|
||||
pub fn serialized_ssh_project(&self) -> Option<SerializedSshProject> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue