Opening this and immediately closing, because it was driving me absolutely nuts most of the day until I understood the root cause. It's not actually a Nightfox issue at all, as it turns out. Hopefully this helps someone one day in the same situation! Thanks so much for Nightfox (and especially Duskfox), I love it to bits. :pray:
I couldn't for the life of me figure out why my Nightfox overrides:
would take effect, but immediately be overridden by a plain @comment.lua highlight (or so I thought). It seemed to happen in all languages. A Dart example, before:
after:
The clue eventually came when I noticed the :Inspect output had an interesting entry tacked on the end:
The new-ish semantic tokens LSP feature adds a highlight group with a higher priority than Treesitter's default 100, completely overriding my changes.
The solution, for me at least, was to disable LSP semantic tokens and let Treesitter do everything. This may not be the best option for all, but I'm happy with it. In your on_attach, add the following:
local on_attach = function(client, bufnr)
-- ...
-- LSP semantic tokens conflicts with Treesitter, turn it off:
client.server_capabilities.semanticTokensProvider = nil
end
Opening this and immediately closing, because it was driving me absolutely nuts most of the day until I understood the root cause. It's not actually a Nightfox issue at all, as it turns out. Hopefully this helps someone one day in the same situation! Thanks so much for Nightfox (and especially Duskfox), I love it to bits. :pray:
I couldn't for the life of me figure out why my Nightfox overrides:
would take effect, but immediately be overridden by a plain
@comment.lua
highlight (or so I thought). It seemed to happen in all languages. A Dart example, before:after:
The clue eventually came when I noticed the
:Inspect
output had an interesting entry tacked on the end:The new-ish semantic tokens LSP feature adds a highlight group with a higher priority than Treesitter's default 100, completely overriding my changes.
The solution, for me at least, was to disable LSP semantic tokens and let Treesitter do everything. This may not be the best option for all, but I'm happy with it. In your
on_attach
, add the following:(and obviously add it to any
lspconfig
blocks):This might be old news to some, but it took me too many hours not to document!