Closed Andrii-Vovk closed 9 months ago
Fixed this for now with an autocommand:
"ColorScheme", { pattern = "*", callback = function() vim.cmd("highlight Identifier ctermfg=White guifg=White") end }
But it seems like a workaround, please let me know, if there is a proper solution
Hiya! Do you know which TypeScript syntax highlighting plugin you're using? Here's what I see using my setup (using HerringtonDarkholme/yats.vim):
It's possible that the syntax highlighting plugin you're using is setting those values, so would be good to track down the root cause of the issue. Thanks!
Hey! Lunarvim uses nvim-treesitter by default. I tried disabling all the plugins that i added on top, and the issue persisted, so it seems that its an issue with treesitter? I'm pretty new to vim, so i'm not sure what are my next steps here, and this seems already out of scope here, as this is not a problem with your theme, but I would appreciate any help! Thanks!
@Andrii-Vovk I expect you're getting those highlights from the TypeScript language server, not from tree-sitter. You can confirm that, as well as what highlight group it's using, by running the :Inspect
ex command with your cursor on one of the symbols that's getting highlighted. For whatever reason, it looks like @lsp.type.variable
links to Identifier
, even though @variable
doesn't.
You can disable highlights from the language server as described here, by removing semanticTokensProvider
from the server_capabilities
. Judging from the LunarVim docs, I think that would look like this:
local default_on_init = require("lvim.lsp").common_on_init
require("lvim.lsp.manager").setup("tsserver", {
on_init = function (client)
client.server_capabilities.semanticTokensProvider = nil
default_on_init(client)
end,
})
Or, if you want to keep the LSP-based highlighting, you can just unlink the one group as described in the Neovim docs: https://github.com/neovim/neovim/blob/32b49448b227588c2fbc93f89743104fd445e0a6/runtime/doc/lsp.txt#L470
Thank you, I really appreciate your help!
@cpmsmith Thanks for digging into this!
Hey! I just installed this theme, and for some reason it makes all the identifiers in .ts files red. Is there a way to change that? I'm really used to them being white in vscode's material theme
I'm using lunarvim; Here is my config: