Fixes #451 inlay hint api change (#452)

Breaking: requires latest neovim nightly (f1dfe32bf5552197e0068298b0527526a4f918b1)
feat(lua): enable(enable:boolean, filter:table) #28374

* Fixes #451 inlay hint api change

Change the calls to inlay_hint.enable to arrange the
parameters in the expected way.

* correct filter table expression
pull/457/head
Matthew Taylor 3 weeks ago committed by GitHub
parent cbc6aca611
commit ae078b8da4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -278,7 +278,7 @@ function M.toggle_inlay_hints()
local bfnrstr = tostring(bufnr)
if inlay_display then
enabled[bfnrstr] = vim.lsp.inlay_hint.is_enabled(bufnr)
vim.lsp.inlay_hint.enable(bufnr, not enabled[bfnrstr])
vim.lsp.inlay_hint.enable(not enabled[bfnrstr], {bufnr=bufnr})
elseif enabled[bfnrstr] then
M.disable_inlay_hints(true)
else
@ -291,7 +291,7 @@ function M.disable_inlay_hints(update, bufnr)
bufnr = bufnr or vim.api.nvim_get_current_buf()
if inlay_display then
-- disable inlay hints
vim.lsp.inlay_hint.enable(bufnr, false)
vim.lsp.inlay_hint.enable(false, {bufnr=bufnr})
enabled[tostring(bufnr)] = false
return
end
@ -319,7 +319,7 @@ function M.set_inlay_hints()
local filetime = fn.getftime(fname)
if inlay_display then
local wrap = utils.throttle(function()
vim.lsp.inlay_hint.enable(bufnr)
vim.lsp.inlay_hint.enable(true, {bufnr=bufnr})
should_update[fname] = filetime
end, 300)
return wrap()

Loading…
Cancel
Save