diff --git a/lua/noice/health.lua b/lua/noice/health.lua index 33fc018d..5ba3cff2 100644 --- a/lua/noice/health.lua +++ b/lua/noice/health.lua @@ -144,14 +144,14 @@ function M.check(opts) { opt = "lsp.hover", enabled = Config.options.lsp.hover.enabled, - handler = vim.lsp.handlers["textDocument/hover"], - handler_str = 'vim.lsp.handlers["textDocument/hover"]', + handler = vim.lsp.buf.hover, + handler_str = "vim.lsp.buf.hover", }, { opt = "lsp.signature", enabled = Config.options.lsp.signature.enabled, - handler = vim.lsp.handlers["textDocument/signatureHelp"], - handler_str = 'vim.lsp.handlers["textDocument/signatureHelp"]', + handler = vim.lsp.buf.signature_help, + handler_str = "vim.lsp.buf.signature_help", }, { opt = "lsp.message", diff --git a/lua/noice/lsp/hover.lua b/lua/noice/lsp/hover.lua index 09e2d095..e5a89d88 100644 --- a/lua/noice/lsp/hover.lua +++ b/lua/noice/lsp/hover.lua @@ -7,10 +7,6 @@ local Util = require("noice.util") local M = {} -function M.setup() - vim.lsp.handlers["textDocument/hover"] = M.on_hover -end - function M.on_hover(_, result, ctx) if not (result and result.contents) then if Config.options.lsp.hover.silent ~= true then diff --git a/lua/noice/lsp/init.lua b/lua/noice/lsp/init.lua index 9af2fe27..253bf644 100644 --- a/lua/noice/lsp/init.lua +++ b/lua/noice/lsp/init.lua @@ -17,11 +17,12 @@ M.kinds = { function M.setup() if Config.options.lsp.hover.enabled then - require("noice.lsp.hover").setup() + vim.lsp.buf.hover = M.hover end if Config.options.lsp.signature.enabled then require("noice.lsp.signature").setup() + vim.lsp.buf.signature_help = M.signature end if Config.options.lsp.message.enabled then diff --git a/lua/noice/lsp/signature.lua b/lua/noice/lsp/signature.lua index 0bf39b19..bf54be46 100644 --- a/lua/noice/lsp/signature.lua +++ b/lua/noice/lsp/signature.lua @@ -40,8 +40,6 @@ M.trigger_kind = { } function M.setup() - vim.lsp.handlers["textDocument/signatureHelp"] = M.on_signature - if Config.options.lsp.signature.auto_open.enabled then -- attach to existing buffers for _, client in ipairs((vim.lsp.get_clients or vim.lsp.get_active_clients)()) do