Closed jeffschwartz closed 1 year ago
Currently we have a way to extend the highlights with any you like:
vim.g.gruvbox_baby_highlights = {LspReferenceWhatever = {fg = "#123123", bg = "NONE", style="underline"}}
If you want to use the colors do this:
local colors = require("gruvbox-baby.colors").config()
Thank you @luisiacc. Unfortunately that doesn't really address the underlying problem which, btw, is not limited to only gruvbox-baby but is also exhibited by every color scheme that I have tried that claims to work with Treesitter. Apparently Treesitter is is not currently able to differentiate between function property declarations and function local variables when referenced from within the function body. Have you ever reached out to the maintainers of Treesitter regarding this? Obviously, or maybe not so obviously, there is a flaw in Treesitter's algorithm when it comes to C type languages.
BTW, in every other regard I ❤️ this color scheme and I intend to keep using it :).
I think treesitter doesn't go as far as identifying the semantics of every token, I think what you are referring to is semantic highlighting, which highlights tokens according to their semantic meaning, like references of the same variable, some lsp providers do provide some of this highlighting but others don't, currently there is no highlight for semantic tokens from the lsp on this scheme, but there will be, although I don't know if they will do exactly what you expect.
Yes, @luisiacc, that is exactly what I am referring to. Sorry if I didn't make that more explicit in my op. I am looking forward to Neovim's future support for semantic highlighting. I have been salivating over it ever since I heard Douglas Crockford make mention of it numerous years ago. Thank you again for gruvbox-baby. It has answered many of the issues I had with other implementations of gruvbox.
Neovim supports semantic highlighting using Tree-sitter and LSP semantic tokens but function parameter declarations are not rendered consistently in the function body. I expected function parameters that are referenced in the function body to be rendered in the same color as they are rendered in their declarations but as the image below demonstrates, they are not. They are rendered as if they were declared in the function body (i.e. as variables)... at least in JavaScript and Typescript files.
Is there a config setting that I can use to address this?
My gruvbox-baby config: