Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Language: Fix minor C++ completion label formatting issue (#41544)
A. Teo Welton344f63c6cade
diff --git a/crates/languages/src/c.rs b/crates/languages/src/c.rsindex 3463f450504..8e90cf82136 100644--- a/crates/languages/src/c.rs+++ b/crates/languages/src/c.rs@@ -166,13 +166,24 @@ impl super::LspAdapter for CLspAdapter {None => "",};- let label = completion+ let mut label = completion.label.strip_prefix('•').unwrap_or(&completion.label).trim()- .to_owned()- + label_detail;+ .to_owned();++ if !label_detail.is_empty() {+ let should_add_space = match completion.kind {+ Some(lsp::CompletionItemKind::FUNCTION | lsp::CompletionItemKind::METHOD) => false,+ _ => true,+ };++ if should_add_space && !label.ends_with(' ') && !label_detail.starts_with(' ') {+ label.push(' ');+ }+ label.push_str(label_detail);+ }match completion.kind {Some(lsp::CompletionItemKind::FIELD) if completion.detail.is_some() => {