@@ -3,9 +3,7 @@ local M = {}
3
3
local lsp = vim .lsp
4
4
local diagnostic = vim .diagnostic
5
5
6
- -- Initialize a local table with severity names to prevent having to create a table in every call of
7
- -- the diagnostic function to improve performance
8
- local severity_names = { " Information" , " Hint" , " Warning" , " Error" }
6
+ local severity_names = { " Error" , " Warning" , " Information" , " Hint" }
9
7
10
8
function M .is_lsp_attached ()
11
9
return next (lsp .buf_get_clients (0 )) ~= nil
@@ -42,19 +40,23 @@ local function diagnostics(severity)
42
40
end
43
41
44
42
function M .diagnostic_errors ()
45
- return diagnostics (diagnostic .severity .ERROR ), ' '
43
+ -- TODO: replace with diagnostic.severity.ERROR when 0.5 is no longer used
44
+ return diagnostics (1 ), ' '
46
45
end
47
46
48
47
function M .diagnostic_warnings ()
49
- return diagnostics (diagnostic .severity .WARN ), ' '
48
+ -- TODO: replace with diagnostic.severity.WARN when 0.5 is no longer used
49
+ return diagnostics (2 ), ' '
50
50
end
51
51
52
52
function M .diagnostic_info ()
53
- return diagnostics (diagnostic .severity .INFO ), ' '
53
+ -- TODO: replace with diagnostic.severity.INFO when 0.5 is no longer used
54
+ return diagnostics (3 ), ' '
54
55
end
55
56
56
57
function M .diagnostic_hints ()
57
- return diagnostics (diagnostic .severity .HINT ), ' '
58
+ -- TODO: replace with diagnostic.severity.HINT when 0.5 is no longer used
59
+ return diagnostics (4 ), ' '
58
60
end
59
61
60
62
return M
0 commit comments