@@ -246,10 +246,10 @@ local fancy_floating_markdown = function(contents, opts)
246246 return bufnr , winnr
247247end
248248
249- local callback = ' textDocument/hover'
250- M .default_callback = vim .lsp .callbacks [ callback ]
249+ local handler = ' textDocument/hover'
250+ M .default_handler = vim .lsp .handlers [ handler ]
251251
252- local function callback_function (_ , method , result )
252+ local function handler_function (_ , method , result )
253253 -- if M.winnr ~= nil and api.nvim_win_is_valid(M.winnr) then
254254 -- api.nvim_win_close(M.winnr, true)
255255 -- end
@@ -297,16 +297,16 @@ local function callback_function(_, method, result)
297297 return bufnr , winnr
298298 end )
299299 else
300- M .default_callback (_ , method , result , _ )
300+ M .default_handler (_ , method , result , _ )
301301 end
302302end
303303
304304M .autoOpenHoverInPopup = function ()
305305 if vim .fn .pumvisible () ~= 1 then return end
306306 for _ , client in pairs (vim .lsp .buf_get_clients (0 )) do
307- local default_callback = client .config .callbacks [' textDocument/hover' ] or vim .lsp .callbacks [' textDocument/hover' ]
308- if default_callback ~= callback_function then
309- client .config .callbacks [' textDocument/hover' ] = callback_function
307+ local default_handler = ( client .config .handlers or {}) [' textDocument/hover' ] or vim .lsp .handlers [' textDocument/hover' ]
308+ if default_handler ~= handler_function then
309+ client .config .handlers [' textDocument/hover' ] = handler_function
310310 end
311311 end
312312
0 commit comments