language server: Fix restarts sometimes not working for buffers open in go-to-definition view (cherry-pick #27655) (#27657)

gcp-cherry-pick-bot[bot] and Piotr Osiewicz created

Cherry-picked language server: Fix restarts sometimes not working for
buffers open in go-to-definition view (#27655)

Closes #ISSUE

Release Notes:

- Fixed language server restarts sometimes not restarting a language
server.

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>

Change summary

crates/collab/src/tests/following_tests.rs | 4 ++--
crates/project/src/lsp_store.rs            | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

Detailed changes

crates/collab/src/tests/following_tests.rs 🔗

@@ -570,7 +570,7 @@ async fn test_following_tab_order(
     client_a
         .fs()
         .insert_tree(
-            "/a",
+            util::path!("/a"),
             json!({
                 "1.txt": "one",
                 "2.txt": "two",
@@ -578,7 +578,7 @@ async fn test_following_tab_order(
             }),
         )
         .await;
-    let (project_a, worktree_id) = client_a.build_local_project("/a", cx_a).await;
+    let (project_a, worktree_id) = client_a.build_local_project(util::path!("/a"), cx_a).await;
     active_call_a
         .update(cx_a, |call, cx| call.set_location(Some(&project_a), cx))
         .await

crates/project/src/lsp_store.rs 🔗

@@ -3715,7 +3715,7 @@ impl LspStore {
                 *refcount += 1;
             }
 
-            if !ignore_refcounts || *refcount == 1 {
+            if ignore_refcounts || *refcount == 1 {
                 local.register_buffer_with_language_servers(buffer, cx);
             }
             if !ignore_refcounts {