typescript: Highlight variables and enums in completions, add details (#9873)
This partially fixes #5287 by surfacing origin of a completion. Before:  After:  Release Notes: - Improved typescript-language-server integration by surfacing more information about completion items.
This commit is contained in:
parent
b1ad60a2ef
commit
044b516d98
1 changed files with 2 additions and 1 deletions
|
@ -143,11 +143,12 @@ impl LspAdapter for TypeScriptLspAdapter {
|
|||
let len = item.label.len();
|
||||
let grammar = language.grammar()?;
|
||||
let highlight_id = match item.kind? {
|
||||
Kind::CLASS | Kind::INTERFACE => grammar.highlight_id_for_name("type"),
|
||||
Kind::CLASS | Kind::INTERFACE | Kind::ENUM => grammar.highlight_id_for_name("type"),
|
||||
Kind::CONSTRUCTOR => grammar.highlight_id_for_name("type"),
|
||||
Kind::CONSTANT => grammar.highlight_id_for_name("constant"),
|
||||
Kind::FUNCTION | Kind::METHOD => grammar.highlight_id_for_name("function"),
|
||||
Kind::PROPERTY | Kind::FIELD => grammar.highlight_id_for_name("property"),
|
||||
Kind::VARIABLE => grammar.highlight_id_for_name("variable"),
|
||||
_ => None,
|
||||
}?;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue