From 3cd8202cd4557832a64242e00898b88e58ed3dbb Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 2 Aug 2024 14:28:58 +0200 Subject: [PATCH] feat(config): mark deprecated items specially fixes https://github.com/max397574/care.nvim/issues/59 --- lua/care/config.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/care/config.lua b/lua/care/config.lua index f8f1d9a..0a354ad 100644 --- a/lua/care/config.lua +++ b/lua/care/config.lua @@ -12,13 +12,15 @@ config.defaults = { border = "rounded", position = "auto", format_entry = function(entry) + local deprecated = entry.completion_item.deprecated + or vim.tbl_contains(entry.completion_item.tags or {}, 1) local completion_item = entry.completion_item local type_icons = config.options.ui.type_icons -- TODO: remove since now can only be number, or also allow custom string kinds? local entry_kind = type(completion_item.kind) == "string" and completion_item.kind or require("care.utils.lsp").get_kind_name(completion_item.kind) return { - { { completion_item.label .. " ", "@care.entry" } }, + { { completion_item.label .. " ", deprecated and "Comment" or "@care.entry" } }, { { " " .. (type_icons[entry_kind] or type_icons.Text) .. " ",