diff --git a/crates/collab/src/tests/editor_tests.rs b/crates/collab/src/tests/editor_tests.rs index 4e6cdb0e79aba494bd01137cc262a097a084217e..8796ed0b0c480cf92d7b808db815f9561059677a 100644 --- a/crates/collab/src/tests/editor_tests.rs +++ b/crates/collab/src/tests/editor_tests.rs @@ -3295,10 +3295,11 @@ async fn test_lsp_pull_diagnostics( editor.handle_input(":", window, cx); }); pull_diagnostics_handle.next().await.unwrap(); + pull_diagnostics_handle.next().await.unwrap(); assert_eq!( - 4, + 5, diagnostics_pulls_made.load(atomic::Ordering::Acquire), - "Client lib.rs edits should trigger another diagnostics pull for a buffer" + "Client lib.rs edits should trigger another diagnostics pull for open buffers" ); workspace_diagnostics_pulls_handle.next().await.unwrap(); assert_eq!( @@ -3314,10 +3315,11 @@ async fn test_lsp_pull_diagnostics( }); pull_diagnostics_handle.next().await.unwrap(); pull_diagnostics_handle.next().await.unwrap(); + pull_diagnostics_handle.next().await.unwrap(); assert_eq!( - 6, + 8, diagnostics_pulls_made.load(atomic::Ordering::Acquire), - "Client main.rs edits should trigger another diagnostics pull by both client and host as they share the buffer" + "Client main.rs edits should trigger diagnostics pull by both client and host and an extra pull for the client's lib.rs" ); workspace_diagnostics_pulls_handle.next().await.unwrap(); assert_eq!( @@ -3333,10 +3335,11 @@ async fn test_lsp_pull_diagnostics( }); pull_diagnostics_handle.next().await.unwrap(); pull_diagnostics_handle.next().await.unwrap(); + pull_diagnostics_handle.next().await.unwrap(); assert_eq!( - 8, + 11, diagnostics_pulls_made.load(atomic::Ordering::Acquire), - "Host main.rs edits should trigger another diagnostics pull by both client and host as they share the buffer" + "Host main.rs edits should trigger another diagnostics pull by both client and host and another pull for the client's lib.rs" ); workspace_diagnostics_pulls_handle.next().await.unwrap(); assert_eq!( @@ -3364,7 +3367,7 @@ async fn test_lsp_pull_diagnostics( .into_response() .expect("workspace diagnostics refresh request failed"); assert_eq!( - 8, + 11, diagnostics_pulls_made.load(atomic::Ordering::Acquire), "No single file pulls should happen after the diagnostics refresh server request" ); diff --git a/crates/editor/src/editor.rs b/crates/editor/src/editor.rs index 6e6091ec8a7a37be324359de25d16c120b68882f..c58eaa84fc2d277c42e9202f4c0d90fbb77d4064 100644 --- a/crates/editor/src/editor.rs +++ b/crates/editor/src/editor.rs @@ -18921,7 +18921,7 @@ impl Editor { if already_used_buffers.insert(buffer_id) { if let Some(worktree_id) = buffer.file().map(|f| f.worktree_id(cx)) { return !edited_buffer_ids.contains(&buffer_id) - && !edited_worktree_ids.contains(&worktree_id); + && edited_worktree_ids.contains(&worktree_id); } } false