HiPhish / rainbow-delimiters.nvim

Rainbow delimiters for Neovim with Tree-sitter
https://gitlab.com/HiPhish/rainbow-delimiters.nvim
Apache License 2.0
532 stars 39 forks source link

Add more `c` queries #74

Closed Danielkonge closed 9 months ago

Danielkonge commented 9 months ago

I found some more missing c queries. I don't actually know c that well (I just found these while going through the neovim codebase), so I can't write tests that won't have the LSP give some complaints. Feel free to edit this, if you are more used to c (or suggest changes and I will update it).

Also, there is some problem with highlighting in macros (I made a comment about it in the test file). I am not sure what is wrong there and haven't had time to look into it in more details yet.

HiPhish commented 9 months ago

I have gone ahead and fixed the syntax of the test file. It should now cover all the patterns you want to match. The macro_type_specifier still baffles me, I don't know what exactly it is supposed to represent. I can get it to show up if I use a macro both for the function name and return type, but why would anyone want to do such a thing?

Danielkonge commented 9 months ago

I have gone ahead and fixed the syntax of the test file. It should now cover all the patterns you want to match.

Thank you, the fixes look good to me. I squashed the commits now, is there anything else you would want to update before committing to the main branch?

The macro_type_specifier still baffles me, I don't know what exactly it is supposed to represent. I can get it to show up if I use a macro both for the function name and return type, but why would anyone want to do such a thing?

I am not sure what exactly it is supposed to represent, but it did show up in the neovim codebase when I looked through it (I am not sure if I can find it again easily though...), so it is at least something that is used.

HiPhish commented 9 months ago

Merged, thank you. BTW, sometimes highlighting inside a macro does work for me: Screenshot_20231223_014804

Danielkonge commented 9 months ago

Merged, thank you. BTW, sometimes highlighting inside a macro does work for me: Screenshot_20231223_014804

That is weird, I don't think I have seen it working for me. Do you have any idea of what might have been different when it did work? In general, I still don't really know what causes the problems with the macros.

HiPhish commented 9 months ago

It could be an issue with Neovim 0.10. The highlighting is correct on 0.9.4 for me.

Danielkonge commented 9 months ago

It could be an issue with Neovim 0.10. The highlighting is correct on 0.9.4 for me.

I can reproduce this. Highlighting also works in 0.9.4 for me, but not in 0.10. I can see that 0.9.5 was just released, I can test that later. Knowing that it comes from a recent update, we should be able to narrow it down a lot by looking at the differences between 0.9.4, 0.9.5 and 0.10.