You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments