feat: icon_fetcher adds symbol parameter

This commit is contained in:
eph
2024-12-27 11:25:43 +08:00
parent ffde729b63
commit a3717e7a4e
2 changed files with 4 additions and 3 deletions

View File

@@ -52,8 +52,9 @@ local lspkind = {
---@param kind string|integer
---@param bufnr integer
---@param symbol? outline.Symbol
---@return string icon
function M.icon_from_kind(kind, bufnr)
function M.icon_from_kind(kind, bufnr, symbol)
local kindstr = kind
if type(kind) ~= 'string' then
kindstr = M.kinds[kind]
@@ -63,7 +64,7 @@ function M.icon_from_kind(kind, bufnr)
end
if type(cfg.o.symbols.icon_fetcher) == 'function' then
local icon = cfg.o.symbols.icon_fetcher(kindstr, bufnr)
local icon = cfg.o.symbols.icon_fetcher(kindstr, bufnr, symbol)
-- Allow returning empty string
if icon then
return icon