Rename runnables into tasks (#8119)

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2024-02-21 14:56:43 +02:00 committed by GitHub
parent 45e2c01773
commit 2679457b02
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
30 changed files with 316 additions and 332 deletions

View file

@ -4,8 +4,8 @@ pub mod lsp_command;
pub mod lsp_ext_command;
mod prettier_support;
pub mod project_settings;
mod runnable_inventory;
pub mod search;
mod task_inventory;
pub mod terminals;
pub mod worktree;
@ -94,7 +94,7 @@ use util::{
pub use fs::*;
#[cfg(any(test, feature = "test-support"))]
pub use prettier::FORMAT_SUFFIX as TEST_PRETTIER_FORMAT_SUFFIX;
pub use runnable_inventory::Inventory;
pub use task_inventory::Inventory;
pub use worktree::*;
const MAX_SERVER_REINSTALL_ATTEMPT_COUNT: u64 = 4;
@ -158,7 +158,7 @@ pub struct Project {
default_prettier: DefaultPrettier,
prettiers_per_worktree: HashMap<WorktreeId, HashSet<Option<PathBuf>>>,
prettier_instances: HashMap<PathBuf, PrettierInstance>,
runnables: Model<Inventory>,
tasks: Model<Inventory>,
}
pub enum LanguageServerToQuery {
@ -621,7 +621,7 @@ impl Project {
.detach();
let copilot_lsp_subscription =
Copilot::global(cx).map(|copilot| subscribe_for_copilot_events(&copilot, cx));
let runnables = Inventory::new(cx);
let tasks = Inventory::new(cx);
Self {
worktrees: Vec::new(),
@ -673,7 +673,7 @@ impl Project {
default_prettier: DefaultPrettier::default(),
prettiers_per_worktree: HashMap::default(),
prettier_instances: HashMap::default(),
runnables,
tasks,
}
})
}
@ -697,7 +697,7 @@ impl Project {
.await?;
let this = cx.new_model(|cx| {
let replica_id = response.payload.replica_id as ReplicaId;
let runnables = Inventory::new(cx);
let tasks = Inventory::new(cx);
// BIG CAUTION NOTE: The order in which we initialize fields here matters and it should match what's done in Self::local.
// Otherwise, you might run into issues where worktree id on remote is different than what's on local host.
// That's because Worktree's identifier is entity id, which should probably be changed.
@ -782,7 +782,7 @@ impl Project {
default_prettier: DefaultPrettier::default(),
prettiers_per_worktree: HashMap::default(),
prettier_instances: HashMap::default(),
runnables,
tasks,
};
this.set_role(role, cx);
for worktree in worktrees {
@ -1065,8 +1065,8 @@ impl Project {
cx.notify();
}
pub fn runnable_inventory(&self) -> &Model<Inventory> {
&self.runnables
pub fn task_inventory(&self) -> &Model<Inventory> {
&self.tasks
}
pub fn collaborators(&self) -> &HashMap<proto::PeerId, Collaborator> {