add lsp diagnostics to bufferline

This commit is contained in:
2024-11-19 12:27:14 -05:00
parent f982efc79b
commit 0dbf952a9a
+27
View File
@@ -33,6 +33,33 @@ return {
separator = true,
},
},
custom_areas = {
right = function()
local result = {}
local seve = vim.diagnostic.severity
local error = #vim.diagnostic.get(0, { severity = seve.ERROR })
local warning = #vim.diagnostic.get(0, { severity = seve.WARN })
local info = #vim.diagnostic.get(0, { severity = seve.INFO })
local hint = #vim.diagnostic.get(0, { severity = seve.HINT })
if error ~= 0 then
table.insert(result, { text = "" .. error, link = "DiagnosticError" })
end
if warning ~= 0 then
table.insert(result, { text = "" .. warning, link = "DiagnosticWarn" })
end
if hint ~= 0 then
table.insert(result, { text = "" .. hint, link = "DiagnosticHint" })
end
if info ~= 0 then
table.insert(result, { text = "" .. info, link = "DiagnosticInfo" })
end
return result
end,
},
},
},
}