diff --git a/crates/editor/src/code_context_menus.rs b/crates/editor/src/code_context_menus.rs index f220cadee5acca5c7c1d3c91b9350380bc0bf10e..9a2b8c385689f284fc42e49a5c7451b3774fe018 100644 --- a/crates/editor/src/code_context_menus.rs +++ b/crates/editor/src/code_context_menus.rs @@ -8,6 +8,7 @@ use gpui::{ use itertools::Itertools; use language::CodeLabel; use language::{Buffer, LanguageName, LanguageRegistry}; +use lsp::CompletionItemTag; use markdown::{Markdown, MarkdownElement}; use multi_buffer::{Anchor, ExcerptId}; use ordered_float::OrderedFloat; @@ -840,7 +841,16 @@ impl CompletionsMenu { if completion .source .lsp_completion(false) - .and_then(|lsp_completion| lsp_completion.deprecated) + .and_then(|lsp_completion| { + match (lsp_completion.deprecated, &lsp_completion.tags) + { + (Some(true), _) => Some(true), + (_, Some(tags)) => Some( + tags.contains(&CompletionItemTag::DEPRECATED), + ), + _ => None, + } + }) .unwrap_or(false) { highlight.strikethrough = Some(StrikethroughStyle { diff --git a/crates/lsp/src/lsp.rs b/crates/lsp/src/lsp.rs index 84e5a95ed80e75bf7d338b589f5b1c1c6495a616..af6760a36817ed4857ad070768c645832f053ca8 100644 --- a/crates/lsp/src/lsp.rs +++ b/crates/lsp/src/lsp.rs @@ -764,6 +764,10 @@ impl LanguageServer { // "textEdit".to_string(), ], }), + deprecated_support: Some(true), + tag_support: Some(TagSupport { + value_set: vec![CompletionItemTag::DEPRECATED], + }), insert_replace_support: Some(true), label_details_support: Some(true), insert_text_mode_support: Some(InsertTextModeSupport {