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:
parent
13ee78c0b4
commit
3850da6bee
1 changed files with 25 additions and 5 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue