fix(nvim): inlay_hints API changed

This commit is contained in:
Jalil David Salamé Messina 2024-04-22 12:48:39 +02:00
parent 8b2d08d721
commit 87efdebd12
Signed by: jalil
GPG key ID: F016B9E770737A0B

View file

@ -54,12 +54,11 @@
end
-- Enable inlay hints if supported
if capabilities.inlayHintProvider then
vim.lsp.inlay_hint.enable(bufnr, true)
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
end
vim.keymap.set('n', -- Some Lsp servers do not advertise inlay hints properly so enable this keybinding regardless
'<space>ht',
function()
vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled())
-- Some Lsp servers do not advertise inlay hints properly so enable this keybinding regardless
vim.keymap.set('n', '<space>ht', function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled(), { bufnr = 0 })
end,
{ desc = '[H]ints [T]oggle', ${opts} }
)