Browse Source

[nvim] fix: lsp count in statusline

vim.lsp.diagnostic.get_count() got deprecated
dev
David JULIEN 5 months ago
parent
commit
7a0030b064
  1. 7
      .config/nvim/lua/statusline.lua

7
.config/nvim/lua/statusline.lua

@ -109,7 +109,12 @@ local function get_lsp_diagnostics(bufnr)
}
for k, level in pairs(levels) do
result[k] = vim.lsp.diagnostic.get_count(bufnr, level)
local count = 0
local diags = vim.diagnostic.get(bufnr, { severity = level })
for _, _ in pairs(diags) do
count = count + 1
end
result[k] = count
end
return result

Loading…
Cancel
Save