From 730eed1ccc6f1673049d07279763b1a1c7919166 Mon Sep 17 00:00:00 2001 From: Naim A <227396+naim94a@users.noreply.github.com> Date: Thu, 27 Feb 2025 05:33:55 +0200 Subject: [PATCH] lsp: Send clang-specific client capabilities only to clang --- crates/lsp/src/lsp.rs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/crates/lsp/src/lsp.rs b/crates/lsp/src/lsp.rs index a354cefc745094..ab9b21f448af62 100644 --- a/crates/lsp/src/lsp.rs +++ b/crates/lsp/src/lsp.rs @@ -838,18 +838,21 @@ impl LanguageServer { const METHOD: &'static str = Initialize::METHOD; } let mut params = serde_json::to_value(params).unwrap(); - merge_non_null_json_value_into( - serde_json::json!({ - "capabilities": { - "textDocument": { - "inactiveRegionsCapabilities": { - "inactiveRegions": true, + + if self.name().0 == "clangd" { + merge_non_null_json_value_into( + serde_json::json!({ + "capabilities": { + "textDocument": { + "inactiveRegionsCapabilities": { + "inactiveRegions": true, + } } } - } - }), - &mut params, - ); + }), + &mut params, + ); + } cx.spawn(|_| async move { let response = self.request::(params).await?;