Add formatting.deprecated option
This commit is contained in:
@@ -51,6 +51,7 @@ return function()
|
||||
mapping = {},
|
||||
|
||||
formatting = {
|
||||
deprecated = true,
|
||||
format = function(_, vim_item)
|
||||
return vim_item
|
||||
end
|
||||
|
||||
@@ -204,8 +204,10 @@ entry.get_vim_item = function(self, suggest_offset)
|
||||
end
|
||||
|
||||
-- deprecated
|
||||
if completion_item.deprecated or vim.tbl_contains(completion_item.tags or {}, types.lsp.CompletionItemTag.Deprecated) then
|
||||
abbr = str.strikethrough(abbr)
|
||||
if config.get().formatting.deprecated then
|
||||
if completion_item.deprecated or vim.tbl_contains(completion_item.tags or {}, types.lsp.CompletionItemTag.Deprecated) then
|
||||
abbr = str.strikethrough(abbr)
|
||||
end
|
||||
end
|
||||
|
||||
-- append delta text
|
||||
|
||||
@@ -75,6 +75,7 @@ cmp.ScrollDirection.Down = 'down'
|
||||
---@field public comparators function[]
|
||||
|
||||
---@class cmp.FormattingConfig
|
||||
---@field public deprecated boolean
|
||||
---@field public format fun(entry: cmp.Entry, vim_item: vim.CompletedItem): vim.CompletedItem
|
||||
|
||||
---@class cmp.SnippetConfig
|
||||
|
||||
Reference in New Issue
Block a user