Debounce language server file system events (#30773)
This helps prevent a race condition where the language server would update in the middle of a `git checkout` Release Notes: - N/A
This commit is contained in:
parent
df66237428
commit
b1c7fa1dac
2 changed files with 63 additions and 20 deletions
|
@ -1,8 +1,8 @@
|
|||
#![allow(clippy::format_collect)]
|
||||
|
||||
use crate::{
|
||||
Event, git_store::StatusEntry, task_inventory::TaskContexts, task_store::TaskSettingsLocation,
|
||||
*,
|
||||
Event, git_store::StatusEntry, lsp_store::FS_WATCH_DEBOUNCE_TIMEOUT,
|
||||
task_inventory::TaskContexts, task_store::TaskSettingsLocation, *,
|
||||
};
|
||||
use buffer_diff::{
|
||||
BufferDiffEvent, CALCULATE_DIFF_TASK, DiffHunkSecondaryStatus, DiffHunkStatus,
|
||||
|
@ -1190,6 +1190,9 @@ async fn test_reporting_fs_changes_to_language_servers(cx: &mut gpui::TestAppCon
|
|||
|
||||
// The language server receives events for the FS mutations that match its watch patterns.
|
||||
cx.executor().run_until_parked();
|
||||
cx.executor().advance_clock(FS_WATCH_DEBOUNCE_TIMEOUT);
|
||||
cx.executor().run_until_parked();
|
||||
|
||||
assert_eq!(
|
||||
&*file_changes.lock(),
|
||||
&[
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue