Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Include Typescript completion item `detail` field in completion label

Julia93a634991be5
diff --git a/crates/zed/src/languages/typescript.rs b/crates/zed/src/languages/typescript.rs
index 95f56bce5b5..f54b09ceda5 100644
--- a/crates/zed/src/languages/typescript.rs
+++ b/crates/zed/src/languages/typescript.rs
@@ -128,8 +128,14 @@ impl LspAdapter for TypeScriptLspAdapter {
Kind::PROPERTY | Kind::FIELD => grammar.highlight_id_for_name("property"),
_ => None,
}?;
+
+ let text = match &item.detail {
+ Some(detail) => format!("{} {}", item.label, detail),
+ None => item.label.clone(),
+ };
+
Some(language::CodeLabel {
- text: item.label.clone(),
+ text,
runs: vec![(0..len, highlight_id)],
filter_range: 0..len,
})