feat: icon_fetcher adds symbol parameter
This commit is contained in:
@@ -37,7 +37,7 @@ local function parse_result(result, depth, hierarchy, parent, bufnr)
|
|||||||
local node = {
|
local node = {
|
||||||
deprecated = value.deprecated,
|
deprecated = value.deprecated,
|
||||||
kind = value.kind,
|
kind = value.kind,
|
||||||
icon = symbols.icon_from_kind(value.kind, bufnr),
|
icon = symbols.icon_from_kind(value.kind, bufnr, value),
|
||||||
name = value.name or value.text,
|
name = value.name or value.text,
|
||||||
detail = value.detail,
|
detail = value.detail,
|
||||||
line = selectionRange.start.line,
|
line = selectionRange.start.line,
|
||||||
|
|||||||
@@ -52,8 +52,9 @@ local lspkind = {
|
|||||||
|
|
||||||
---@param kind string|integer
|
---@param kind string|integer
|
||||||
---@param bufnr integer
|
---@param bufnr integer
|
||||||
|
---@param symbol? outline.Symbol
|
||||||
---@return string icon
|
---@return string icon
|
||||||
function M.icon_from_kind(kind, bufnr)
|
function M.icon_from_kind(kind, bufnr, symbol)
|
||||||
local kindstr = kind
|
local kindstr = kind
|
||||||
if type(kind) ~= 'string' then
|
if type(kind) ~= 'string' then
|
||||||
kindstr = M.kinds[kind]
|
kindstr = M.kinds[kind]
|
||||||
@@ -63,7 +64,7 @@ function M.icon_from_kind(kind, bufnr)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if type(cfg.o.symbols.icon_fetcher) == 'function' then
|
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
|
-- Allow returning empty string
|
||||||
if icon then
|
if icon then
|
||||||
return icon
|
return icon
|
||||||
|
|||||||
Reference in New Issue
Block a user