Merge pull request #2005 from zed-industries/tsserver-include-completion-detail

Include Typescript completion item `detail` field in completion label
This commit is contained in:
Julia 2023-01-03 16:44:10 -05:00 committed by GitHub
commit 1e18480808
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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,
})