working nvf!
This commit is contained in:
parent
719c8842c3
commit
d26fdccf7a
53 changed files with 330 additions and 172 deletions
|
@ -1,16 +1,16 @@
|
|||
-- luacheck: ignore
|
||||
local float_options = {
|
||||
border = 'single',
|
||||
max_width = math.ceil(vim.api.nvim_win_get_width(0) * 0.6),
|
||||
max_height = math.ceil(vim.api.nvim_win_get_height(0) * 0.8),
|
||||
border = 'single',
|
||||
max_width = math.ceil(vim.api.nvim_win_get_width(0) * 0.6),
|
||||
max_height = math.ceil(vim.api.nvim_win_get_height(0) * 0.8),
|
||||
}
|
||||
|
||||
vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
virtual_text = true,
|
||||
signs = false,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
virtual_text = true,
|
||||
signs = false,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = true,
|
||||
})
|
||||
|
||||
vim.lsp.handlers['textDocument/show_line_diagnostics'] = vim.lsp.with(vim.lsp.handlers.hover, float_options)
|
||||
|
@ -18,17 +18,17 @@ vim.lsp.handlers['textDocument/show_line_diagnostics'] = vim.lsp.with(vim.lsp.ha
|
|||
-- Prevent show notification
|
||||
-- <https://github.com/neovim/neovim/issues/20457#issuecomment-1266782345>
|
||||
vim.lsp.handlers['textDocument/hover'] = function(_, result, ctx, config)
|
||||
config = config or float_options
|
||||
config.focus_id = ctx.method
|
||||
if not result then
|
||||
return
|
||||
end
|
||||
local markdown_lines = vim.lsp.util.convert_input_to_markdown_lines(result.contents)
|
||||
markdown_lines = vim.lsp.util.trim_empty_lines(markdown_lines)
|
||||
if vim.tbl_isempty(markdown_lines) then
|
||||
return
|
||||
end
|
||||
return vim.lsp.util.open_floating_preview(markdown_lines, 'markdown', config)
|
||||
config = config or float_options
|
||||
config.focus_id = ctx.method
|
||||
if not result then
|
||||
return
|
||||
end
|
||||
local markdown_lines = vim.lsp.util.convert_input_to_markdown_lines(result.contents)
|
||||
markdown_lines = vim.lsp.util.trim_empty_lines(markdown_lines)
|
||||
if vim.tbl_isempty(markdown_lines) then
|
||||
return
|
||||
end
|
||||
return vim.lsp.util.open_floating_preview(markdown_lines, 'markdown', config)
|
||||
end
|
||||
|
||||
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, float_options)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue