Rename deprioritize_task -> deprioritize

Max Brunsfeld created

It applies to a family of tasks, not a task.

Change summary

crates/gpui2/src/app/test_context.rs | 1 +
crates/gpui2/src/executor.rs         | 2 +-
crates/project2/src/project_tests.rs | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)

Detailed changes

crates/gpui2/src/app/test_context.rs 🔗

@@ -354,6 +354,7 @@ impl<T: Send> Model<T> {
             })
         });
 
+        // Run other tasks until the event is emitted.
         loop {
             match rx.try_next() {
                 Ok(Some(event)) => return event,

crates/gpui2/src/executor.rs 🔗

@@ -245,7 +245,7 @@ impl BackgroundExecutor {
     }
 
     #[cfg(any(test, feature = "test-support"))]
-    pub fn deprioritize_task(&self, task_label: TaskLabel) {
+    pub fn deprioritize(&self, task_label: TaskLabel) {
         self.dispatcher.as_test().unwrap().deprioritize(task_label)
     }
 

crates/project2/src/project_tests.rs 🔗

@@ -2609,7 +2609,7 @@ async fn test_file_changes_multiple_times_on_disk(cx: &mut gpui::TestAppContext)
 
     // Simulate buffer diffs being slow, so that they don't complete before
     // the next file change occurs.
-    cx.executor().deprioritize_task(*language::BUFFER_DIFF_TASK);
+    cx.executor().deprioritize(*language::BUFFER_DIFF_TASK);
 
     // Change the buffer's file on disk, and then wait for the file change
     // to be detected by the worktree, so that the buffer starts reloading.