* feat: explicitly set all to false in iter_matches
Due to neovim's breaking change for treesitter, in nightly build the
option all is set to true by default
* feat: use nil value to make iter_matches use default
* perf: remove unnecessary check for no `bufnr` as it's already checked a few commits prior
* fix(lsp): remove unnecessary warning in `fetch_symbols`. Fixes#393
* fix: restore buffer defaults
---------
Co-authored-by: Steven Arcangeli <506791+stevearc@users.noreply.github.com>
* feat: added a highlight group for the left-hand side of the Nav float ui to indicate the parent of the current symbol
* feature tweak: made sure to force focus on the left-hand side if the list on the left-hand side is super long
* format: apply stylua
* fix: restore AerialVariableIcon hl group
* refactor: use full-line highlighting in nvim 0.10
---------
Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
When opening nvim in diffview (`nvim -c DiffviewOpen`) and then toggeling aerial,
aerial errors when trying to call `vim.api.nvim_win_is_valid(bufdata.last_win)`
as bufdata.last_win == nil. This change adds a check and returns in case of a nil
value.
Co-authored-by: Linus Boehm <linusboehm@gmail.com>
Some LSP servers are less than consistent with pushing diagnostics. For
this and other reasons, I think tying the symbol refresh to diagnostics
is maybe not the best move. The first step I'm going to take is to make
the default behavior use a simple change listener, like the treesitter
backend. I may eventually deprecate and remove this behavior entirely.
On Neovim 0.10, calling timer:stop() is not canceling the callback.
There appears to be some minimum amount of buffer time remaining in the
timer in order for it to be able to be canceled correctly. I'm getting
around this by adding a simple guard statement
When moving away from nvim-treesitter helpers, I overlooked the caching
they were performing. This means that currently on every symbols
refetch, neovim scans filesystem and gets all queries. Definitely useful
when writing new queries, but slow nonetheless.
This commit introduces a simple query cache and an API method to clear
said cache. With this, performance should improve, yet a way to iterate
over query design remains accessible.
* Process scope captures
This lets us avoid complex querying when extracting scope.
As long as the capture includes a scoping node in a `@scope` capture,
its text will be extracted and used as a scope value.
If "public" is named differently in some language,
`#set @scope "text" "public"` will do the trick for a cost of an
additional query.
* Add basic query documentation to readme and vimdoc
* Add reusable language extensions info to readme
This has direct impact on highlighting. If scope is set and set to
anything but "public", highlighter will use a separate highlight for
the corresponding entry. This was previously used by Elixir extension
by manually processing nodes.
Ruby queries are updated to deal with both predicate and statement
versions of scope setting.
* Use vim.treesitter instead of nvim-treesitter helpers
0.10 compatible nvim-treesitter is removing a lot of code, since main
functionality is readily available in the core neovim.
This commit extracts all calls to nvim-treesitter helpers in favor of
neovim core functions, own implementations, or clones of nvim-treesitter
functions. This aligns with nvim-treesitter `main` branch description of
being a parser installation helper and queries repository.
Co-Authored-By: Steven Arcangeli <stevearc@stevearc.com>
Co-Authored-By: Chen Shuaimin <chen_shuaimin@outlook.com>
* cleanup: remove unnecessary has_query helper
* refactor: replace get_at_path with more specific helper
---------
Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
Co-authored-by: Chen Shuaimin <chen_shuaimin@outlook.com>
* fix(render): use EOL extmarks to render AerialLine (`rpad` is no longer needed)
* fix: remove unused variable and max_width calculation
* fix(render): set strict=false. Only happens when line is last in the buffer, and strict-false still shows it correctly
---------
Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
Ruby allows us to do a lot of weird stuff, and having weirdness glaring
at us from the side panel can be handy for when we sober up and start
cleaning.
This commit handles a number of singleton class manipulation cases,
as well as adds a reciever information to singleton method declarations.
Using the treesitter backend, we can use the same "selectionRange" logic
that LSP symbol sources use to provide more detailed information about
where the name of the symbol is. We already use the LSP information to
change how we navigate the cursor to symbols, so once we parse this
information from treesitter it will automatically get used.
I'm putting this behind an experimental config option for now so we can
test it out for a while before making a sudden change to the behavior.