diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2024-12-18 13:24:53 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-18 13:24:53 +0000 |
| commit | 4db0f680bde4ace130cc0ac9a7295ca594c5f7eb (patch) | |
| tree | 23b03094483bc956fd08c986a4eaac056928ed58 | |
| parent | 20bc7533c497589fe9112fa00dbf1a8e40fd8085 (diff) | |
| parent | 11536cc5848a58b7ab88be3dc7058cbeaa6fdc1b (diff) | |
| download | rust-4db0f680bde4ace130cc0ac9a7295ca594c5f7eb.tar.gz rust-4db0f680bde4ace130cc0ac9a7295ca594c5f7eb.zip | |
Merge pull request #18714 from Veykril/push-krxvsqwrokwp
fix: Do not ask the client to resolve for non existing label details
| -rw-r--r-- | src/tools/rust-analyzer/crates/rust-analyzer/src/lsp/to_proto.rs | 6 |
1 files 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 3e0a7f32ce1..06d02b63f20 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(), |
