Skip to content

Commit

Permalink
fix: lsp inlay hint API change.
Browse files Browse the repository at this point in the history
  • Loading branch information
bigduu authored and mehalter committed Apr 20, 2024
1 parent 2ac3632 commit 9386ed4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lua/astrolsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ M.on_attach = function(client, bufnr)
if client.supports_method "textDocument/inlayHint" then
if vim.b[bufnr].inlay_hints == nil then vim.b[bufnr].inlay_hints = M.config.features.inlay_hints end
-- TODO: remove check after dropping support for Neovim v0.9
if vim.lsp.inlay_hint and vim.b[bufnr].inlay_hints then vim.lsp.inlay_hint.enable(bufnr, true) end
if vim.lsp.inlay_hint and vim.b[bufnr].inlay_hints then vim.lsp.inlay_hint.enable(true, { bufnr = bufnr }) end
end

if client.supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens then
Expand Down
2 changes: 1 addition & 1 deletion lua/astrolsp/toggles.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function M.buffer_inlay_hints(bufnr, silent)
vim.b[bufnr].inlay_hints = not vim.b[bufnr].inlay_hints
-- TODO: remove check after dropping support for Neovim v0.9
if vim.lsp.inlay_hint then
vim.lsp.inlay_hint.enable(bufnr, vim.b[bufnr].inlay_hints)
vim.lsp.inlay_hint.enable(vim.b[bufnr].inlay_hints, { bufnr = bufnr })
ui_notify(silent, ("Inlay hints %s"):format(bool2str(vim.b[bufnr].inlay_hints)))
end
end
Expand Down

0 comments on commit 9386ed4

Please sign in to comment.