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

Commit

Permalink
fix: fix LSP provider
Browse files Browse the repository at this point in the history
fix #192
  • Loading branch information
lukas-reineke committed Dec 24, 2021
1 parent 4893372 commit 29f5cbf
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lua/feline/providers/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ local M = {}
local lsp = vim.lsp
local diagnostic = vim.diagnostic

-- Initialize a local table with severity names to prevent having to create a table in every call of
-- the diagnostic function to improve performance
local severity_names = { "Information", "Hint", "Warning", "Error" }
local severity_names = { "Error", "Warning", "Information", "Hint" }

function M.is_lsp_attached()
return next(lsp.buf_get_clients(0)) ~= nil
Expand Down Expand Up @@ -42,19 +40,23 @@ local function diagnostics(severity)
end

function M.diagnostic_errors()
return diagnostics(diagnostic.severity.ERROR), ''
-- TODO: replace with diagnostic.severity.ERROR when 0.5 is no longer used
return diagnostics(1), ''
end

function M.diagnostic_warnings()
return diagnostics(diagnostic.severity.WARN), ''
-- TODO: replace with diagnostic.severity.WARN when 0.5 is no longer used
return diagnostics(2), ''
end

function M.diagnostic_info()
return diagnostics(diagnostic.severity.INFO), ''
-- TODO: replace with diagnostic.severity.INFO when 0.5 is no longer used
return diagnostics(3), ''
end

function M.diagnostic_hints()
return diagnostics(diagnostic.severity.HINT), ''
-- TODO: replace with diagnostic.severity.HINT when 0.5 is no longer used
return diagnostics(4), ''
end

return M

0 comments on commit 29f5cbf

Please sign in to comment.