fix(lsp): update to new inlay_hint API (Neovim 0.10 only)
This commit is contained in:
@@ -292,8 +292,8 @@ M.on_attach = function(client, bufnr)
|
||||
if client.supports_method "textDocument/inlayHint" then
|
||||
if vim.b.inlay_hints_enabled == nil then vim.b.inlay_hints_enabled = vim.g.inlay_hints_enabled end
|
||||
-- TODO: remove check after dropping support for Neovim v0.9
|
||||
if vim.lsp.buf.inlay_hint then
|
||||
if vim.b.inlay_hints_enabled then vim.lsp.buf.inlay_hint(bufnr, true) end
|
||||
if vim.lsp.inlay_hint then
|
||||
if vim.b.inlay_hints_enabled then vim.lsp.inlay_hint(bufnr, true) end
|
||||
lsp_mappings.n["<leader>uH"] = {
|
||||
function() require("astronvim.utils.ui").toggle_buffer_inlay_hints(bufnr) end,
|
||||
desc = "Toggle LSP inlay hints (buffer)",
|
||||
|
||||
@@ -96,8 +96,8 @@ end
|
||||
function M.toggle_buffer_inlay_hints(bufnr)
|
||||
vim.b.inlay_hints_enabled = not vim.b.inlay_hints_enabled
|
||||
-- TODO: remove check after dropping support for Neovim v0.9
|
||||
if vim.lsp.buf.inlay_hint then
|
||||
vim.lsp.buf.inlay_hint(bufnr or 0, vim.b.inlay_hints_enabled)
|
||||
if vim.lsp.inlay_hint then
|
||||
vim.lsp.inlay_hint(bufnr or 0, vim.b.inlay_hints_enabled)
|
||||
notify(string.format("Inlay hints %s", bool2str(vim.b.inlay_hints_enabled)))
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user