HiPhish / rainbow-delimiters.nvim

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

[Enhancement] Set a non-empty namespace or improve the docs #42

Closed Danielkonge closed 8 months ago

Danielkonge commented 9 months ago

It would be easier to capture the highlight colors used by rainbow-decimeters, if it used a namespace other than "". E.g., "rainbow_delimeters" would allow one to get the namespace id via vim.api.nvim_get_namespaces()["rainbow_delimeters"], which doesn't seem to work with the empty string.

I skimmed the code in this repository and found this: https://github.com/HiPhish/rainbow-delimiters.nvim/blob/652345bd1aa333f60c9cbb1259f77155786e5514/test/highlight/highlight_spec.lua#L160C1-L160C1

but can't see where rainbow_ns is defined and this is the only thing that shows up in the code when you search for it.

There is also this: https://github.com/HiPhish/rainbow-delimiters.nvim/blob/652345bd1aa333f60c9cbb1259f77155786e5514/lua/rainbow-delimiters/lib.lua#L37C1-L51C3

where it says something about per language namespaces, but I think it is just per language namespace ids? When I use vim.inspect_pos to actually inspect an element highlighted by rainbow-delimeters, it tells me that the namespace is "".

I think I might be missing some easier way to get the namespace ids, but that is what I recommend to clarify in the docs if that is so.

Danielkonge commented 8 months ago

Having worked more with the code, I think it is probably better to keep the namespaces working as they are right now, so I will close this issue. Getting the namespaces is still something that could have better documentation though.