From b17df0083713dac3dd2575d01844658e05c36fca Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Fri, 28 Mar 2025 13:15:47 +0100 Subject: [PATCH] language server: Fix restarts sometimes not working for buffers open in go-to-definition view (cherry-pick #27655) (#27658) 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> --- crates/collab/src/tests/following_tests.rs | 4 ++-- crates/project/src/lsp_store.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/collab/src/tests/following_tests.rs b/crates/collab/src/tests/following_tests.rs index fa5caf011628fdac5c13e3ec24e3c697746776db..3cf4452c20aa05ccd820cd21d7f3d68a6b0b69a9 100644 --- a/crates/collab/src/tests/following_tests.rs +++ b/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 diff --git a/crates/project/src/lsp_store.rs b/crates/project/src/lsp_store.rs index 32b4c05841fce1c70eaa29007d9413c698f47284..b237e3c66138c09fe856e770d90e44c2320c9a2e 100644 --- a/crates/project/src/lsp_store.rs +++ b/crates/project/src/lsp_store.rs @@ -3891,7 +3891,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 {