From 93a634991be58783ae2c15df3118412fe20f2578 Mon Sep 17 00:00:00 2001 From: Julia Date: Tue, 3 Jan 2023 16:37:35 -0500 Subject: [PATCH] Include Typescript completion item `detail` field in completion label --- crates/zed/src/languages/typescript.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/zed/src/languages/typescript.rs b/crates/zed/src/languages/typescript.rs index 95f56bce5b..f54b09ceda 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, })