From 3e0c5c10b73fe8db87780ab63c3be2ee995d6870 Mon Sep 17 00:00:00 2001 From: Vitaly Slobodin Date: Sat, 19 Oct 2024 00:52:17 +0200 Subject: [PATCH] lsp: Handle unregistration "textDocument/rename" from a server (#19427) Hi. While working on https://github.com/zed-industries/zed/pull/19230 I noticed that some servers send a request to unregistered the `textDocument/rename` capability. I thought it would be good to handle that message in Zed: ```plaintext [2024-10-18T21:25:07+02:00 WARN project::lsp_store] unhandled capability unregistration: Unregistration { id: "biome_rename", method: "textDocument/rename" } ``` So this pull request implements that. Thanks. Release Notes: - N/A --- crates/project/src/lsp_store.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/project/src/lsp_store.rs b/crates/project/src/lsp_store.rs index 61f959259d5ab897b3941fb49188589e4030543d..fe0a6443bc8118ec7ef7f7d67ac10ceda502b89d 100644 --- a/crates/project/src/lsp_store.rs +++ b/crates/project/src/lsp_store.rs @@ -6057,6 +6057,16 @@ impl LspStore { ); })?; } + "textDocument/rename" => { + this.update(&mut cx, |this, _| { + if let Some(server) = this.language_server_for_id(server_id) + { + server.update_capabilities(|capabilities| { + capabilities.rename_provider = None + }) + } + })?; + } "textDocument/rangeFormatting" => { this.update(&mut cx, |this, _| { if let Some(server) = this.language_server_for_id(server_id)