feat: support vim.diagnostic.is_disabled() (#2232)

Co-authored-by: Alexander Courtis <alex@courtis.org>
This commit is contained in:
Steven Stallion
2023-06-10 01:10:28 -05:00
committed by GitHub
parent 576d4c1b03
commit 8d82c4dbe1

View File

@@ -27,6 +27,12 @@ end
local function from_nvim_lsp()
local buffer_severity = {}
local is_disabled = false
if vim.fn.has "nvim-0.9" == 1 then
is_disabled = vim.diagnostic.is_disabled()
end
if not is_disabled then
for _, diagnostic in ipairs(vim.diagnostic.get(nil, { severity = M.severity })) do
local buf = diagnostic.bufnr
if vim.api.nvim_buf_is_valid(buf) then
@@ -37,6 +43,7 @@ local function from_nvim_lsp()
end
end
end
end
return buffer_severity
end