From ae078b8da431f264ab488d6d4e14201761dbfdbc Mon Sep 17 00:00:00 2001 From: Matthew Taylor Date: Sun, 21 Apr 2024 23:55:37 -0500 Subject: [PATCH] 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 --- lua/go/inlay.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lua/go/inlay.lua b/lua/go/inlay.lua index 411a1bc..aecc7f5 100644 --- a/lua/go/inlay.lua +++ b/lua/go/inlay.lua @@ -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()