This commit removed the ability to receive symbols from all attached
clients in the current buffer. Everything works as before when only one
client is attached to a buffer.
This also fixes outline LSP finding clients on nvim-0.7
It makes sense to store the provider each sidebar is using with own
self.provider fields, no way that did not occur to me before this.
The old `_G._outline_current_provider` ironically, can now be replaced
by `require('outline').current.provider`.
Primarily:
- Utils
- Sidebar (removed the need of writer.lua)
- Resolve keymaps shortcut in config eraly
- Put highlight functions into highlight.lua
- Put functions that do stuff on outline window into view.lua
Currently the implementation is very limited.
Ref: #24
- Outline must be open and have been loaded for it to work (requires
lazy loading or headless loading of Sidebar)
- Empty string returned if cursor is not in any symbol ('closest' symbol
not yet supported)
- Line column not used
- Returning concatenated symbol names rather than a list of tables with
node info (requires a refactor of outline.SymbolNode type)
- Subject to config.symbols.filter and folds (requires finding hover
list somewhere outside of writer.make_outline)
Option to auto unfold when there is only N root nodes in outline.
Defaults to 1, meaning if there is only one 'root' parent, it should
always be unfolded.
This is useful if the entire file is a single function or a single
'return'.
The old auto_unfold_hover option **still works as expected**.
No more obnoxious '}' on the cmdline when pressing `?`!
scope:
- More type hints
- Added class Float for creating floating windows with size that fit the
content and position centered on the screen
- show_help action for outline window (key `?`) now uses a floating
window
- :OutlineStatus now provides better information, and shows content in a
floating window.
future:
- Floating window option configuration
- preview window can adapt based on position of outline window, and not
based on config value of `position` left/right
- it can also properly vertically center-align, even when there are
horizontal splits below the outline
- fixed a few bugs associated with previous rewrite commits in init.lua
config:
- Added min_height for preview window
This commit introduces a basic framework for symbol filtering in
outline.nvim, where users can set per-filetype kinds to filter - include
or exclude for each filetype.
As a side effect the checking of symbol inclusion function has been
improved to O(1) time-complexity (previously O(n)). You can see this
from types/outline.lua and config.lua: a lookup table is used to check
if a kind is filtered, rather than looping through a list each time.
Former takes O(1) for lookup whereas the old implementation would be
O(n) for *each* node!
The old symbols.blacklist option *still works as expected*.
The schema for the new confit is detailed in #23 and types/outline.lua.
By the way, this commit also closes#23.
These should equivalent:
symbols.blacklist = { 'Function', 'Method' }
symbols.filter = { 'Function', 'Method', exclude=true }
symbols.filter = {
['*'] = { 'Function', 'Method', exclude=true }
}
And these should be equivalent:
symbols.blacklist = {}
symbols.filter = false
symbols.filter = nil
symbols.filter = { ['*'] = false }
symbols.filter = { ['*'] = { exclude = true } }
symbols.filter = { exclude = true }
The last two of which could be considered unidiomatic.
When multiple filetypes are specified, filetype specific filters
are NOT merged with the default ('*') filter, they are independent. If a
filetype is used, the default filter is not considered. The default
filter is only considered if a filetype filter for the given buffer is
not provided.
LIMITATIONS:
This is carried over from the implementation from symbols-outline:
filters can only be applied to parents at the moment. I.e.: If some node
has a kind that is excluded, all its children will NOT be considered.
Filters are only applied to children if its parent was not excluded
during filtering.
Also extracted all types into types module, and updated conversion
script to use the new symbols.filter opt.
NOTE:
On outline open it appears that parsing functions are called twice?
I should definitely add tests soon.