File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,11 @@ function M.buffer_semantic_tokens(bufnr, silent)
6767 -- TODO: remove check after dropping support for Neovim v0.9
6868 --- @diagnostic disable-next-line : deprecated
6969 for _ , client in ipairs ((vim .lsp .get_clients or vim .lsp .get_active_clients ) { bufnr = bufnr }) do
70- if client .server_capabilities .semanticTokensProvider then
71- vim .lsp .semantic_tokens [vim .b [bufnr ].semantic_tokens and " start" or " stop" ](bufnr , client .id )
70+ if client .supports_method " textDocument/semanticTokens/full" then
71+ -- HACK: `semantic_tokens.start/stop` don't support 0 for current buffer
72+ local real_bufnr = bufnr == 0 and vim .api .nvim_get_current_buf () or bufnr
73+ vim .lsp .semantic_tokens [vim .b [bufnr ].semantic_tokens and " start" or " stop" ](real_bufnr , client .id )
74+ vim .lsp .semantic_tokens .force_refresh (bufnr )
7275 toggled = true
7376 end
7477 end
You can’t perform that action at this time.
0 commit comments