Fix: multiple tree-sitter highlighting bugs #89
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The precedence order for neovim (and now the tree-sitter CLI as well it seems?) is to prefer the last match found rather than the first. This moves ad over to use the same behaviour but I still need to update the existing highlight queries as there are now several places where the ordering is incorrect if we want to maintain the existing highlighting.
This should make it easier to port over existing queries from neovim but I'm currently guarding and rejecting queries that use unknown custom predicates (such as neovim's
#lua-match?
) as the resulting highlights are all messed up if we don't correctly implement the same logic used by whichever editor or tool the query was taken from.The tree-sitter tests can now run in CI as I've updated the setup of parsers and TS state to support using Rust crates rather than dynamic linking.
Fixes #76 and should also address the issue encountered in #88
byte_to_char
in theTextProvider
implementation forGapBuffer
. This has been fixed and the method has been renamed toraw_byte_to_char
to make the required arguments clearer.tree_sitter_rust
andtree_sitter_python
crates to allow these tests to run without requiring on-disk.so
files.Still left to do