Merge pull request #109 from epheien/feat-icon_fetcher
feat: icon_fetcher adds symbol parameter
This commit is contained in:
18
README.md
18
README.md
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user