Skip to content

Commit

Permalink
fix(init): only check for available servers if lspconfig is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Jun 19, 2023
1 parent 0c18ac0 commit cfec478
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lua/neoconf/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ end
function M.check_setup()
local util = require("neoconf.util")
if vim.fn.has("nvim-0.7.2") == 0 then
util.error("**settings.nvim** requires Neovim >= 0.7.2")
util.error("**neoconf.nvim** requires Neovim >= 0.7.2")
end
local ok, lsputil = pcall(require, "lspconfig.util")
if ok then
local lsputil = package.loaded["lspconfig.util"]
if lsputil then
if #lsputil.available_servers() == 0 then
return true
else
Expand All @@ -73,7 +73,9 @@ function M.check_setup()
)
end
else
util.error("**nvim-lspconfig** not installed?")
-- lspconfig has not ben loaded yet
-- so all is good
return true
end
end

Expand Down

0 comments on commit cfec478

Please sign in to comment.