Debounce runnable refreshes in the editor (#20470)
This commit is contained in:
@@ -9194,18 +9194,18 @@ impl Editor {
|
||||
self.clear_tasks();
|
||||
return Task::ready(());
|
||||
}
|
||||
let project = self.project.clone();
|
||||
let project = self.project.as_ref().map(Model::downgrade);
|
||||
cx.spawn(|this, mut cx| async move {
|
||||
cx.background_executor().timer(UPDATE_DEBOUNCE).await;
|
||||
let Some(project) = project.and_then(|p| p.upgrade()) else {
|
||||
return;
|
||||
};
|
||||
let Ok(display_snapshot) = this.update(&mut cx, |this, cx| {
|
||||
this.display_map.update(cx, |map, cx| map.snapshot(cx))
|
||||
}) else {
|
||||
return;
|
||||
};
|
||||
|
||||
let Some(project) = project else {
|
||||
return;
|
||||
};
|
||||
|
||||
let hide_runnables = project
|
||||
.update(&mut cx, |project, cx| {
|
||||
// Do not display any test indicators in non-dev server remote projects.
|
||||
@@ -14879,3 +14879,5 @@ fn check_multiline_range(buffer: &Buffer, range: Range<usize>) -> Range<usize> {
|
||||
range.start..range.start
|
||||
}
|
||||
}
|
||||
|
||||
const UPDATE_DEBOUNCE: Duration = Duration::from_millis(50);
|
||||
|
||||
Reference in New Issue
Block a user