Skip to content

Commit b455099

Browse files
committed
fix: fix disabling semantic_tokens
1 parent af7dced commit b455099

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lua/astrolsp/init.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,12 @@ M.on_attach = function(client, bufnr)
194194
if vim.lsp.inlay_hint and vim.b[bufnr].inlay_hints then vim.lsp.inlay_hint(bufnr, true) end
195195
end
196196

197-
if client.supports_method and vim.lsp.semantic_tokens then
198-
if vim.b[bufnr].semantic_tokens == nil then vim.b[bufnr].semantic_tokens = M.config.features.semantic_tokens end
199-
if not vim.b[bufnr].semantic_tokens then vim.lsp.semantic_tokens["stop"](bufnr, client.id) end
197+
if client.supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens then
198+
if M.config.features.semantic_tokens then
199+
vim.b[bufnr].semantic_tokens = true
200+
else
201+
client.server_capabilities.semanticTokensProvider = nil
202+
end
200203
end
201204

202205
for mode, maps in pairs(M.config.mappings) do

0 commit comments

Comments
 (0)