From 11536cc5848a58b7ab88be3dc7058cbeaa6fdc1b Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 18 Dec 2024 14:03:50 +0100 Subject: [PATCH] fix: Do not ask the client ro resolve for non existing label details --- .../rust-analyzer/crates/rust-analyzer/src/lsp/to_proto.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/to_proto.rs b/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/to_proto.rs index 3e0a7f32ce12..06d02b63f20c 100644 --- a/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/to_proto.rs +++ b/src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/to_proto.rs @@ -372,9 +372,11 @@ fn completion_item( }; if config.completion_label_details_support() { + let has_label_details = + item.label.detail_left.is_some() || item.label.detail_left.is_some(); if fields_to_resolve.resolve_label_details { - something_to_resolve |= true; - } else if item.label.detail_left.is_some() || item.label.detail_left.is_some() { + something_to_resolve |= has_label_details; + } else if has_label_details { lsp_item.label_details = Some(lsp_types::CompletionItemLabelDetails { detail: item.label.detail_left.clone(), description: item.label.detail_right.clone(),