fix(nvim): fill in icons for missing ones in lspkind for cmp
This commit is contained in:
parent
df1e59de2b
commit
b694b4bb05
@ -27,6 +27,10 @@ cmp.setup({
|
|||||||
spell = { symbol = " ", name = "Spell", hl_group = "Spell" },
|
spell = { symbol = " ", name = "Spell", hl_group = "Spell" },
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local extra_kind_icons = {
|
||||||
|
TypeParameter = ""
|
||||||
|
}
|
||||||
|
|
||||||
local selection = selections[entry.source.name]
|
local selection = selections[entry.source.name]
|
||||||
if not selection then
|
if not selection then
|
||||||
local kind = require("lspkind").cmp_format({
|
local kind = require("lspkind").cmp_format({
|
||||||
@ -34,8 +38,12 @@ cmp.setup({
|
|||||||
maxwidth = 50,
|
maxwidth = 50,
|
||||||
})(entry, vim_item)
|
})(entry, vim_item)
|
||||||
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||||
|
if not strings[2] then
|
||||||
|
strings[2] = strings[1]
|
||||||
|
strings[1] = extra_kind_icons[strings[1]] or ""
|
||||||
|
end
|
||||||
kind.kind = " " .. strings[1] .. " "
|
kind.kind = " " .. strings[1] .. " "
|
||||||
vim_item.menu = strings[1] .. " " .. strings[2]
|
vim_item.menu = (strings[1] or "") .. " " .. (strings[2] or "")
|
||||||
return kind
|
return kind
|
||||||
else
|
else
|
||||||
local word = entry:get_insert_text()
|
local word = entry:get_insert_text()
|
||||||
|
Loading…
Reference in New Issue
Block a user