Skip to content
This repository was archived by the owner on Sep 20, 2023. It is now read-only.

Commit 29f5cbf

Browse files
committed
fix: fix LSP provider
fix #192
1 parent 4893372 commit 29f5cbf

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

lua/feline/providers/lsp.lua

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@ local M = {}
33
local lsp = vim.lsp
44
local diagnostic = vim.diagnostic
55

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" }
97

108
function M.is_lsp_attached()
119
return next(lsp.buf_get_clients(0)) ~= nil
@@ -42,19 +40,23 @@ local function diagnostics(severity)
4240
end
4341

4442
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), ''
4645
end
4746

4847
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), ''
5050
end
5151

5252
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), ''
5455
end
5556

5657
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), ''
5860
end
5961

6062
return M

0 commit comments

Comments
 (0)