Nvim 0 6 lsp signature changes (#56)
* bugfix diagnostic error * bugfix for code lens for neovim 0.6 * gh test workflow * bugfix github workflowpull/60/head
parent
f33a3e8e7d
commit
08dba1beb6
@ -1,23 +1,24 @@
|
|||||||
-- TODO: change background and use TextView?
|
-- TODO: change background and use TextView?
|
||||||
local lsp = require("vim.lsp")
|
local lsp = require("vim.lsp")
|
||||||
return { hover_handler = function(_, method, result)
|
|
||||||
vim.lsp.util.focusable_float(
|
|
||||||
method,
|
|
||||||
function()
|
|
||||||
if not (result and result.contents) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local markdown_lines = lsp.util.convert_input_to_markdown_lines(result.contents)
|
|
||||||
markdown_lines = lsp.util.trim_empty_lines(markdown_lines)
|
|
||||||
if vim.tbl_isempty(markdown_lines) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local bnr, contents_winid, _, border_winid = vim.lsp.util.fancy_floating_markdown(markdown_lines)
|
local mk_handler = require"navigator.util".mk_handler
|
||||||
lsp.util.close_preview_autocmd({"CursorMoved", "BufHidden", "InsertCharPre"}, contents_winid)
|
return {
|
||||||
lsp.util.close_preview_autocmd({"CursorMoved", "BufHidden", "InsertCharPre"}, border_winid)
|
hover_handler = mk_handler(function(_, result, ctx, cfg)
|
||||||
return bnr, contents_winid
|
vim.lsp.util.focusable_float(ctx.method or "Hover", function()
|
||||||
|
if not (result and result.contents) then
|
||||||
|
return
|
||||||
end
|
end
|
||||||
)
|
local markdown_lines = lsp.util.convert_input_to_markdown_lines(result.contents)
|
||||||
end
|
markdown_lines = lsp.util.trim_empty_lines(markdown_lines)
|
||||||
|
if vim.tbl_isempty(markdown_lines) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local bnr, contents_winid, _, border_winid =
|
||||||
|
vim.lsp.util.fancy_floating_markdown(markdown_lines)
|
||||||
|
lsp.util.close_preview_autocmd({"CursorMoved", "BufHidden", "InsertCharPre"}, contents_winid)
|
||||||
|
lsp.util.close_preview_autocmd({"CursorMoved", "BufHidden", "InsertCharPre"}, border_winid)
|
||||||
|
return bnr, contents_winid
|
||||||
|
end)
|
||||||
|
end)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue