Skip to content

Commit

Permalink
feat(config): mark deprecated items specially
Browse files Browse the repository at this point in the history
fixes #59
  • Loading branch information
max397574 committed Aug 2, 2024
1 parent d534ca9 commit 3cd8202
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/care/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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) .. " ",
Expand Down

0 comments on commit 3cd8202

Please sign in to comment.