Merge pull request #109 from epheien/feat-icon_fetcher

feat: icon_fetcher adds symbol parameter
This commit is contained in:
~hedy
2025-01-05 08:58:42 +08:00
committed by GitHub
3 changed files with 22 additions and 3 deletions

View File

@@ -921,6 +921,24 @@ symbols = {
-- ...
end,
}
```
The `icon_fetcher` function may also accept a third parameter, the symbol
which type is outline.Symbol. Provider can add extra info to symbol.
For example, access specifier information can be added at the icon location.
```lua
symbols = {
icon_fetcher = function(kind, bufnr, symbol)
local access_icons = { public = '○', protected = '◉', private = '●' }
local icon = require('outline.config').o.symbols.icons[kind].icon
-- ctags provider add `access` key
if symbol and symbol.access then
return icon .. ' ' .. access_icons[symbol.access]
end
return icon
end,
}
```
See [this section](#custom-icons) for other examples of this function.