Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look into supporting injections and locals in tree-sitter highlighting #92

Open
sminez opened this issue Feb 16, 2025 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@sminez
Copy link
Owner

sminez commented Feb 16, 2025

Please describe the change / addition you'd like to see made

The way the tree-sitter highlighting library works (and by extension, most existing tree-sitter parsers and queries) the tokenisation of a given file is split between highlights (currently implemented in ad), injections and locals as documented here. ad is only aiming for minimal support for highlighting but it looks as though many parsers are written with this set up in mind. tree-sitter-markdown has example bindings showing how to make use of the two parsers it provides but it looks to be somewhat custom rather than the more
generic approach used in helix (see here as well) which I'm still trying to fully wrap my head around. I assume that there is a reason why it isn't as simple as "just" parsing nodes marked as being injections with a different parsers and splicing those tokens into the ones obtained from the parent, but I'll need to look into things further to be sure.

@sminez sminez added the enhancement New feature or request label Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant