From d7f137ea7a0e648cc545cfb55b2f4b6658ff9cae Mon Sep 17 00:00:00 2001 From: Jason Boatman Date: Wed, 23 Oct 2024 12:57:11 -0500 Subject: [PATCH 1/2] Fix checking for `false` `labelDetailsSupport` value. --- .../rust-analyzer/crates/rust-analyzer/src/lsp/capabilities.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/capabilities.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/capabilities.rs index 3b19284f241..871cde58dce 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/capabilities.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/capabilities.rs @@ -212,7 +212,8 @@ pub fn completion_label_details_support(&self) -> bool { .label_details_support .as_ref() })() - .is_some() + .copied() + .unwrap_or_default() } fn completion_item(&self) -> Option { From bc6b2ec10ea9c18d40eba3c0b76be823687f653d Mon Sep 17 00:00:00 2001 From: Jason Boatman Date: Wed, 23 Oct 2024 13:19:53 -0500 Subject: [PATCH 2/2] Rewrite `label_details_support` condition to be consistent with other parts of the codebase. --- .../crates/rust-analyzer/src/lsp/capabilities.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/capabilities.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/capabilities.rs index 871cde58dce..939593dd453 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/capabilities.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/capabilities.rs @@ -210,10 +210,7 @@ pub fn completion_label_details_support(&self) -> bool { .completion_item .as_ref()? .label_details_support - .as_ref() - })() - .copied() - .unwrap_or_default() + })() == Some(true) } fn completion_item(&self) -> Option {