HiPhish / nvim-ts-rainbow2

Rainbow delimiters for Neovim through Tree-sitter
https://gitlab.com/HiPhish/nvim-ts-rainbow2
Apache License 2.0
338 stars 35 forks source link

feat(zig): add queries #33

Closed reo101 closed 1 year ago

reo101 commented 1 year ago

I think I've covered everything, please let me know if I've missed something. There's a bug in the highlighting of the switch statements (not sure how to fix it) and I've noted it in the query file.

Here's a screenshot of the test file:

image

Cheers :smile:

HiPhish commented 1 year ago

There's a bug in the highlighting of the switch statements (not sure how to fix it) and I've noted it in the query file.

Yes, that is an issue with Neovim (neovim/neovim#17099), you have a node SwitchExpr with two opening and two closing delimiter nodes on the same level. The correct pattern would be this:

(SwitchExpr
  ["{" "("]+ @opening
  ["}" ")"]+ @closing) @container

However, when we iterate through the nodes of the capture only the first node will be returned. I'd say just leave it as is for now, we have a comment as a reminder in the query file.

reo101 commented 1 year ago

I've updated the comment(s) to better reflect the situation. Turns out that the two asm-related queries (AsmInputItem and AsmOutputItem) also fall victim to the same issue.

HiPhish commented 1 year ago

Merged, thank you