feat(lsp): lsp.completion support set deprecated (#29882)

Problem: CompletionItem in lsp spec mentioned the deprecated attribute

Solution: when item has deprecated attribute set hl_group to DiagnosticDeprecated
          in complete function
This commit is contained in:
glepnir
2024-07-31 22:15:34 +08:00
committed by GitHub
parent 573a71469d
commit 4e90bc3023
3 changed files with 74 additions and 1 deletions

View File

@@ -99,6 +99,13 @@ local constants = {
TriggerForIncompleteCompletions = 3,
},
-- Completion item tags are extra annotations that tweak the rendering of a
-- completion item
CompletionTag = {
-- Render a completion as obsolete, usually using a strike-out.
Deprecated = 1,
},
-- A document highlight kind.
DocumentHighlightKind = {
-- A textual occurrence.
@@ -433,13 +440,16 @@ function protocol.make_client_capabilities()
snippetSupport = true,
commitCharactersSupport = false,
preselectSupport = false,
deprecatedSupport = false,
deprecatedSupport = true,
documentationFormat = { constants.MarkupKind.Markdown, constants.MarkupKind.PlainText },
resolveSupport = {
properties = {
'additionalTextEdits',
},
},
tagSupport = {
valueSet = get_value_set(constants.CompletionTag),
},
},
completionItemKind = {
valueSet = get_value_set(constants.CompletionItemKind),