Skip to content

Commit

Permalink
hover fallback to signature help
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-x committed Nov 25, 2023
1 parent 40d1907 commit 98540ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
9 changes: 7 additions & 2 deletions lua/navigator/hover.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,20 @@ 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
-- require('navigator.util').log(result)
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

Expand Down
10 changes: 5 additions & 5 deletions lua/navigator/lspclient/mapping.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 98540ed

Please sign in to comment.