lsp: Support deprecated completion item tag and advertise capability (#43000)

Release Notes:

- N/A
This commit is contained in:
xdBronch
2025-11-19 12:19:58 +01:00
committed by GitHub
parent 5ccbe945a6
commit 9feb260216
2 changed files with 15 additions and 1 deletions
+11 -1
View File
@@ -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 {
+4
View File
@@ -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 {