* chore: Fix markdown tests
Recent update to nvim-treesitter breaks aerial.nvim tests.
Specifically:
- nvim-treesitter/nvim-treesitter@96f55f3043
- MDeiml/tree-sitter-markdown@cd705f1591
Manually poking around, the behaviour remains the same
* chore: Regenerate ruby symbol snapshots
Prior version held a bunch of data written by hand. This commit updates
it to avoid false alarms when generating symbols for new or updated
queries.
Expectations are not changed, only the order of keys in individual
tables was updated.
* chore: Option to run tests on nvim-treesitter main
While nvim-treesitter is not a strict requirement for aerial.nvim, it
is used to install parsers and it updates nvim default language to
parser assignments with practical values. This commit adds an ability to
run tests against `main` branch by providing `--test-main` option to
`run_tests.sh`.
* chore: Add neorg parser config to main branch
Use C++14 compatible compiler when running tests with `--test-main`,
otherwise parser compilation will fail.
* Added aerial queries for objdump
Added objdump to minimal_init.lua
* ci: tests fail if changes to snapshot files
* cleanup: comments on test filetype special cases
* test: add objdump test snapshots
---------
Co-authored-by: Steven Arcangeli <stevearc@stevearc.com>
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.
Ruby supports some operators overloading by declaring a method with the
operator as the method name, e.g. `def <=>(other)`. Tree sitter ruby
parser recognises these method names as operators, not identifiers, and
as such existing queries skip over them.
This commit adds a query that captures "operator" instance methods.
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.