Skip to content

Commit

Permalink
lsp: Send clang-specific client capabilities only to clang
Browse files Browse the repository at this point in the history
  • Loading branch information
naim94a committed Feb 27, 2025
1 parent dccbc03 commit 730eed1
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions crates/lsp/src/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<InitializeExtended>(params).await?;
Expand Down

0 comments on commit 730eed1

Please sign in to comment.