lsp: Support deprecated completion item tag and advertise capability (#43000)
Release Notes: - N/A
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user