From 3850da6beecbadd628a81c49d6cf92339164b4b7 Mon Sep 17 00:00:00 2001 From: Julia Ryan Date: Wed, 11 Jun 2025 18:12:15 -0700 Subject: [PATCH] debugger: Don't show VSCode worktree tasks when Zed ones exist (#32589) Fixes #31699 Eventually we might want to merge the lists and deduplicate based on the command and args that it's running. For now we'll just use the presence of _any_ worktree local zed debug tasks to disable all VSCode ones. Release Notes: - N/A --- crates/debugger_ui/src/new_process_modal.rs | 30 +++++++++++++++++---- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/crates/debugger_ui/src/new_process_modal.rs b/crates/debugger_ui/src/new_process_modal.rs index a4d7c04dc30d65370c6389f3d3bc895d9d440c6c..921568156dd6be56eb0ec612808ac52c257a80b6 100644 --- a/crates/debugger_ui/src/new_process_modal.rs +++ b/crates/debugger_ui/src/new_process_modal.rs @@ -1168,15 +1168,35 @@ impl DebugDelegate { } let dap_registry = cx.global::(); + let hide_vscode = scenarios.iter().any(|(kind, _)| match kind { + TaskSourceKind::Worktree { + id: _, + directory_in_worktree: dir, + id_base: _, + } => dir.ends_with(".zed"), + _ => false, + }); self.candidates = recent .into_iter() .map(|scenario| Self::get_scenario_kind(&languages, &dap_registry, scenario)) - .chain(scenarios.into_iter().map(|(kind, scenario)| { - let (language, scenario) = - Self::get_scenario_kind(&languages, &dap_registry, scenario); - (language.or(Some(kind)), scenario) - })) + .chain( + scenarios + .into_iter() + .filter(|(kind, _)| match kind { + TaskSourceKind::Worktree { + id: _, + directory_in_worktree: dir, + id_base: _, + } => !(hide_vscode && dir.ends_with(".vscode")), + _ => true, + }) + .map(|(kind, scenario)| { + let (language, scenario) = + Self::get_scenario_kind(&languages, &dap_registry, scenario); + (language.or(Some(kind)), scenario) + }), + ) .collect(); } }