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
This commit is contained in:
Julia Ryan 2025-06-11 18:12:15 -07:00 committed by GitHub
parent 13ee78c0b4
commit 3850da6bee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1168,15 +1168,35 @@ impl DebugDelegate {
}
let dap_registry = cx.global::<DapRegistry>();
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();
}
}