helix-mirror/helix-term
Michael Davis d3575dc0ff
Run textobject queries across injections
With this change textobjects work even within injection layers, so you
can use `]f` to jump to a function definition in a JavaScript `<script>`
tag within HTML for example.

This requires `Syntax::query_iter` - a utility function for running a
query from `HighlightConfiguration` across injection layers - which
comes from the rainbow brackets branch (merged into my driver).
We need to relocate the textobject query from the `LanguageConfiguration`
to the `HighlightConfiguration` in order to access it
per-injection-layer, like we do for the rainbow brackets query. With
that, the only necessary change is to port the contents of
`TextObjectQuery::capture_nodes_any` to a new function that uses
`query_iter` and update callers.

The callers end up being a bit cleaner: they only need to take `Syntax`
now and not `LanguageConfiguration` and the root layer's root
`tree_sitter::Node`.
2024-02-26 06:38:17 -05:00
..
src Run textobject queries across injections 2024-02-26 06:38:17 -05:00
tests Add glob file type support (#8006) 2024-02-11 18:24:20 +01:00
.gitignore Initial import. 2020-05-20 18:14:51 +09:00
build.rs Add icon to Windows executable (#9104) 2024-01-28 18:31:10 +09:00
Cargo.toml build(deps): bump toml from 0.7.6 to 0.8.10 (#9539) 2024-02-13 01:48:45 +09:00