Improve Zed tasks' ZED_WORKTREE_ROOT fallbacks (#25605)

Closes https://github.com/zed-industries/zed/issues/22912

Reworks the task context infrastructure so that it's possible to have
multiple contexts at the same time, and stores all possible worktree
context there.
Task UI code is now falling back to the "active" worktree context, if
active item's context did not produce a resolved task.

Current code does not produce meaningful results for projects with
multiple worktrees to avoid ambiguity and design changes: instead of
resolving tasks per worktree context available, extra worktree context
is only used when resolving tasks from the same worktree.

Release Notes:

- Improved Zed tasks' `ZED_WORKTREE_ROOT` fallbacks
This commit is contained in:
Kirill Bulatov 2025-02-26 22:30:31 +02:00 committed by GitHub
parent d2b49de0e4
commit b5a1ae6526
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 390 additions and 164 deletions

View file

@ -107,7 +107,7 @@ pub use language::Location;
#[cfg(any(test, feature = "test-support"))]
pub use prettier::FORMAT_SUFFIX as TEST_PRETTIER_FORMAT_SUFFIX;
pub use task_inventory::{
BasicContextProvider, ContextProviderWithTasks, Inventory, TaskSourceKind,
BasicContextProvider, ContextProviderWithTasks, Inventory, TaskContexts, TaskSourceKind,
};
pub use worktree::{
Entry, EntryKind, File, LocalWorktree, PathChange, ProjectEntryId, UpdatedEntriesSet,