Michael Davis 130363bb88 highlighter: Maintain highlight ordering when captures emit out-of-order
This fixes a case that pops up with some specific CSS highlights which
causes the `active_highlights` stack to become out of order. The odd
highlight is this:

    "#" @punctuation
    ((color_value) "#") @string.special
    (color_value) @string.special

The `#` node is fought over by the first two patterns. Requiring that
the pattern matches `#` in the second pattern causes tree-sitter to
finish its capture after the first pattern, so we capture the child node
`{Node # 9..10}` first and then `{Node color_value 9..13}` - reversed of
the normal ordering.

In this case we need to maintain the ordering of `active_highlights` by
`Vec::insert`ing into the correct position.
2025-06-14 21:35:33 -04:00
2025-06-14 21:29:18 -04:00
2025-02-05 15:45:25 -05:00
2024-08-09 02:54:16 +02:00
2024-07-28 02:50:13 +02:00
2024-07-28 02:50:13 +02:00
2025-02-12 20:47:11 -05:00

tree-house

This repository contains a number of crates used by the Helix editor for integration with the tree-sitter C library.

  • bindings/ contains the tree-house-bindings crate which provides Rust bindings over the C library.
  • highlighter/ contains the tree-house crate which exposes a robust highlighter and query iterator for working across [injections].
  • skidder/ contains the skidder crate which exposes utilities for building a package repository for tree-sitter grammars.
  • cli/ contains the skidder-cli crate which wraps skidder in a command line interface.
Description
Cozy Rust bindings to the tree-sitter C library and a robust highlighter
Readme MPL-2.0 1.2 MiB
Languages
Rust 98.4%
Nix 0.9%
Shell 0.7%