debugger: Fix DebugAdapterDelegate::worktree_root always using the first visible worktree (#32585)
Closes #32577 Release Notes: - Fixed debugger malfunctioning when using ZED_WORKTREE_ROOT env variable in multi-worktree workspaces.
This commit is contained in:
parent
1083c0ac53
commit
04223f304b
4 changed files with 45 additions and 15 deletions
|
@ -285,10 +285,12 @@ pub fn task_contexts(
|
|||
.worktree_for_id(*worktree_id, cx)
|
||||
.map_or(false, |worktree| is_visible_directory(&worktree, cx))
|
||||
})
|
||||
.or(workspace
|
||||
.visible_worktrees(cx)
|
||||
.next()
|
||||
.map(|tree| tree.read(cx).id()));
|
||||
.or_else(|| {
|
||||
workspace
|
||||
.visible_worktrees(cx)
|
||||
.next()
|
||||
.map(|tree| tree.read(cx).id())
|
||||
});
|
||||
|
||||
let active_editor = active_item.and_then(|item| item.act_as::<Editor>(cx));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue