mirror of
https://github.com/neovim/neovim.git
synced 2024-09-17 20:58:20 -04:00
Merge 169a159ccc
into a0d8c2b86e
This commit is contained in:
commit
6a3d15de11
@ -42,6 +42,9 @@ DIAGNOSTICS
|
||||
|
||||
• |vim.diagnostic.config()| accepts a "jump" table to specify defaults for
|
||||
|vim.diagnostic.jump()|.
|
||||
• Diagnostics are filtered by severity before being passed to a diagnostic
|
||||
handler |diagnostic-handlers|.
|
||||
|
||||
|
||||
EDITOR
|
||||
|
||||
|
@ -1366,10 +1366,6 @@ M.handlers.signs = {
|
||||
return
|
||||
end
|
||||
|
||||
if opts.signs and opts.signs.severity then
|
||||
diagnostics = filter_by_severity(opts.signs.severity, diagnostics)
|
||||
end
|
||||
|
||||
-- 10 is the default sign priority when none is explicitly specified
|
||||
local priority = opts.signs and opts.signs.priority or 10
|
||||
local get_priority --- @type function
|
||||
@ -1487,16 +1483,11 @@ M.handlers.underline = {
|
||||
})
|
||||
|
||||
bufnr = get_bufnr(bufnr)
|
||||
opts = opts or {}
|
||||
|
||||
if not vim.api.nvim_buf_is_loaded(bufnr) then
|
||||
return
|
||||
end
|
||||
|
||||
if opts.underline and opts.underline.severity then
|
||||
diagnostics = filter_by_severity(opts.underline.severity, diagnostics)
|
||||
end
|
||||
|
||||
local ns = M.get_namespace(namespace)
|
||||
if not ns.user_data.underline_ns then
|
||||
ns.user_data.underline_ns =
|
||||
@ -1566,7 +1557,6 @@ M.handlers.virtual_text = {
|
||||
return
|
||||
end
|
||||
|
||||
local severity --- @type vim.diagnostic.SeverityFilter?
|
||||
if opts.virtual_text then
|
||||
if opts.virtual_text.format then
|
||||
diagnostics = reformat_diagnostics(opts.virtual_text.format, diagnostics)
|
||||
@ -1577,9 +1567,6 @@ M.handlers.virtual_text = {
|
||||
then
|
||||
diagnostics = prefix_source(diagnostics)
|
||||
end
|
||||
if opts.virtual_text.severity then
|
||||
severity = opts.virtual_text.severity
|
||||
end
|
||||
end
|
||||
|
||||
local ns = M.get_namespace(namespace)
|
||||
@ -1591,9 +1578,6 @@ M.handlers.virtual_text = {
|
||||
local virt_text_ns = ns.user_data.virt_text_ns
|
||||
local buffer_line_diagnostics = diagnostic_lines(diagnostics)
|
||||
for line, line_diagnostics in pairs(buffer_line_diagnostics) do
|
||||
if severity then
|
||||
line_diagnostics = filter_by_severity(severity, line_diagnostics)
|
||||
end
|
||||
local virt_texts = M._get_virt_text_chunks(line_diagnostics, opts.virtual_text)
|
||||
|
||||
if virt_texts then
|
||||
@ -1808,7 +1792,8 @@ function M.show(namespace, bufnr, diagnostics, opts)
|
||||
|
||||
for handler_name, handler in pairs(M.handlers) do
|
||||
if handler.show and opts_res[handler_name] then
|
||||
handler.show(namespace, bufnr, diagnostics, opts_res)
|
||||
local filtered = filter_by_severity(opts_res[handler_name].severity, diagnostics)
|
||||
handler.show(namespace, bufnr, filtered, opts_res)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user