fix(lsp): request semantic tokens in BufWinEnter #40513

Problem: A previous refactor removed the BufWinEnter autocmd that
initiated a token request. When an LSP server sends a refresh
notification, then buffers that aren't shown in any window lost their
only trigger to request new tokens.

Solution: Add the BufWinEnter autocmd back which simply requests tokens
for all clients attached to the buffer.
This commit is contained in:
jdrouhard
2026-06-30 18:15:54 -05:00
committed by GitHub
parent d6476eda40
commit 822d96969b

View File

@@ -245,6 +245,14 @@ function STHighlighter:on_attach(client_id)
end,
})
api.nvim_create_autocmd('BufWinEnter', {
buf = self.bufnr,
group = self.augroup,
callback = function()
self:send_request()
end,
})
if state.supports_range then
api.nvim_create_autocmd('WinScrolled', {
buf = self.bufnr,