helix-mirror/helix-core
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 fix lsp config reload (#9415) 2024-02-13 11:58:53 +01:00
.gitignore Initial import. 2020-05-20 18:14:51 +09:00
Cargo.toml build(deps): bump textwrap from 0.16.0 to 0.16.1 (#9674) 2024-02-20 17:07:16 +01:00