From 98540ed2a8f38b4faba3238020985b0d720c9728 Mon Sep 17 00:00:00 2001 From: ray-x Date: Sun, 26 Nov 2023 10:47:45 +1100 Subject: [PATCH] hover fallback to signature help --- lua/navigator/hover.lua | 9 +++++++-- lua/navigator/lspclient/mapping.lua | 10 +++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lua/navigator/hover.lua b/lua/navigator/hover.lua index d940b5d..83e03c8 100644 --- a/lua/navigator/hover.lua +++ b/lua/navigator/hover.lua @@ -8,7 +8,10 @@ function M.handler(_, result, ctx, config) config.focus_id = ctx.method config.zindex = 53 if not (result and result.contents) then - vim.notify('No information available') + -- vim.notify('No information available') + vim.schedule(function() + vim.lsp.buf.signature_help() + end) return end local ft = vim.bo.ft @@ -16,7 +19,9 @@ function M.handler(_, result, ctx, config) local markdown_lines = util.convert_input_to_markdown_lines(result.contents) markdown_lines = nutils.trim_empty_lines(markdown_lines) if vim.tbl_isempty(markdown_lines) then - vim.notify('No information available') + vim.schedule(function() + vim.lsp.buf.signature_help() + end) return end diff --git a/lua/navigator/lspclient/mapping.lua b/lua/navigator/lspclient/mapping.lua index d10b5e4..0d28914 100644 --- a/lua/navigator/lspclient/mapping.lua +++ b/lua/navigator/lspclient/mapping.lua @@ -506,11 +506,11 @@ function M.setup(attach_opts) if _NgConfigValues.border == 'double' then border_style = double end - -- if _NgConfigValues.lsp.hover then - -- vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(require('navigator.hover').handler, { - -- border = border_style, - -- }) - -- end + if _NgConfigValues.lsp.hover.enable then + vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(require('navigator.hover').handler, { + border = border_style, + }) + end if cap.documentFormattingProvider then log('formatting enabled setup hdl') vim.lsp.handlers['textDocument/formatting'] = require('navigator.formatting').format_hdl