Skip to content

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

Description

@sminez

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions