Skip to content

Conversation

@m4rch3n1ng
Copy link

@m4rch3n1ng m4rch3n1ng commented Dec 11, 2025

makes a new function read_query_extends, that is similar to read_query, but it takes a closure that returns an Iterator of Strings in order of priority, and uses that to handle ; extends directives, going down one level of priority for each directive.

the ; extends directive makes it, so that you can define custom queries without having to copy all of the existing ones, by just doing ; extends in your file and then writing your own custom queries.

this is the part on the tree-house side to address helix-editor/helix#14950. i have also made a branch on helix, that shows this in use: https://github.com/m4rch3n1ng/helix/tree/queries-extend.

(note: i didn't change what read_query does and instead added a new function for backwards compatability)

@m4rch3n1ng m4rch3n1ng changed the title support using ; extends in a new read_query_extend fn support using ; extends in a new read_query_extends fn Dec 11, 2025
makes a new function `read_query_extends`, that is similar to
`read_query`, but it takes a closure that returns an Iterator of Strings
in order of priority, and uses that to handle `; extends` directives,
going down one level of priority for each directive.

the `; extends` directive makes it, so that you can define custom queries
without having to copy all of the existing ones, by just doing
`; extends` in your file and then writing your own custom queries.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant