RRethy / base16-nvim

Neovim plugin for building a sync base16 colorscheme. Includes support for Treesitter and LSP highlight groups.
MIT License
523 stars 77 forks source link

feat: enhance lsp semantic highlighting #96

Closed mlwarner closed 7 months ago

mlwarner commented 7 months ago

Uncomment lines for lsp semantic highlighting. This helps with treesitter highlight consistency as the lsp comes online.

I came across this while I was trying to understand color shifts and flickering during startup. My personal config contains these lines:

vim.api.nvim_set_hl(0, "@lsp.type.variable", { link = '@variable' })
vim.api.nvim_set_hl(0, "@lsp.type.property", { link = '@property' })

Can't comment on the other highlight groups, but the names are consistent.

Before

Highlight groups link to Identifer e.g. (@lsp.type.variable.lua links to Identifier priority: 125)

After

Highlight groups link to matching treesitter group e.g. (@lsp.type.variable.lua links to TSVariable priority: 125)

donovanglover commented 7 months ago

FWIW this change caused functions to no longer have the function color when used as variables. Also caused invalid properties to no longer be differentiable from valid ones.